开发者

using lightbox with code igniter

开发者 https://www.devze.com 2023-01-04 04:16 出处:网络
I\'m trying to use Lightbox with my CodeIgniter application. Lightbox says to put the following in the head tag:

I'm trying to use Lightbox with my CodeIgniter application. Lightbox says to put the following in the head tag:

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />

I already had a js folder and a css folder, so I put the js and css folders that came with lightbox within my js and css folder. I changed the 3 script tags and link tags to:

<script type="text/javascript" src="js/js/prototype.js"></script>
<script type="text/javascript" src="js/js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/js/lightbox.js"></script>
<link rel="stylesheet" href="css/css/lightbox.css" type=开发者_C百科"text/css" media="screen" />

(added the /js and /css)

in the view file I have

<a href="http://www.doublediamondllc.com/uploaded/portfolio/<?php echo $row->Thumb;?>" rel="lightbox"><img name="<?php echo $row->Thumb;?>" src="http://www.doublediamondllc.com/uploaded/portfolio/thumbs/<?php echo $row->Thumb;?>"   alt=""></a> 

This displays the thumbnail version, and then when clicked I want it to go to the lightbox, but now it goes to a new tab with the large image.

I've used lightbox before and have always gotten it to work, I'm not really sure what the problem is now, and I tried moving the files all around to different spots but nothing worked.

Thanks in advance!


It seems like the .js isn't getting loaded properly. Try using Firebug, and see if any errors pop up. Alternatively, check the links in the source for the page, and make sure they are pointing to the lightbox js files correctly. If you are using Firefox, view source; the links to the js files should appear as clickable links; click on them and make sure the js file appears, and not a 404 or some other error. Otherwise copy and paste the link attributes to your browser and check the .js paths are correct.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号