I want to use fancybox in one of my CodeIgniter View. First of all, I downloaded fancybox then I Unzip and copy files in application/third_party
folder of CodeIgniter. Then in myView.php I did this:
<script type="text/javascript" src="<?php echo base_url('third_party/fancyBox/lib/jquery.mousewheel-3.0.6.pack.js'); ?>"></script>
but when I use Firefox ( Inspect Element) to see all the request, I got 404 error(of mousewheel-3.0.6.pack.js
). What I'm wrong? Which approach should I follow?
Update:
This is the view part that I'm trying right now:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link rel="stylesheet" src="http://fancyapps.com/fancybox/source/jquery.fancybox.css"></script>
<script src="http://fancyapps.com/fancybox/source/jquery.fancybox.js"></script>
<script type="text/javascript" src="<?php echo base_url('/Fancybox/lib/jquery.mousewheel-3.0.6.pack.js'); ?>"></script>
<title>Private Area</title>
<link rel="stylesheet" href="<?php echo base_url('home_view_style.css');?>">
</head>
<body>
<h4>Benvenuto Utente</h4>
<a href="home/logout">Logout</a>
<a class="fancybox" data-fancybox-type="iframe" rel="group" href="http://www.istruzioneformazionelavoro.it/Engine/RAServeFile.php/f/corsi/84/Tabella_corsi_allegatoDD311.pdf">prova</a>
Don't put it inside application folder, create folder where is your index.php, f.e. assets, extract fancy box there and then inside your view write something like <script src="/asssets/fancyBox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
Aha, the approach - you can extract codeigniter files where your webroot is and it's fine, but as user guide speaks, you can make public folder and put your index.php there, set your domain to point this folder and adjust application and system path inside your index.php. Then, you files are safe outside public sight.
Learn by viewing others people work. I've taken a look at github, recent CI project, there you can clearly see directory structure, where assets are https://github.com/PandaGG/CI_Blog , the index.php file is inside public dir.