使用带有代码点火器的灯箱
我正在尝试将 Lightbox 与我的 CodeIgniter 应用程序一起使用。 Lightbox 说将以下内容放在 head 标签中:
<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" />
我已经有一个 js 文件夹和一个 css 文件夹,所以我将 lightbox 附带的 js 和 css 文件夹放在我的 js 和 css 文件夹中。我将 3 个脚本标签和链接标签更改为:(
<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="text/css" media="screen" />
添加了 /js 和 /css)
在我的视图文件中
<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>
这显示了缩略图版本,然后单击时我希望它转到灯箱,但现在它转到带有大图像的新选项卡。
我以前使用过灯箱,并且总是让它工作,我不太确定现在的问题是什么,我尝试将文件移动到不同的位置,但没有任何效果。
提前致谢!
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="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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
.js 似乎没有正确加载。尝试使用 Firebug,看看是否弹出任何错误。或者,检查页面源中的链接,并确保它们正确指向 lightbox js 文件。如果您使用的是 Firefox,请查看源代码; js 文件的链接应显示为可点击的链接;单击它们并确保出现 js 文件,而不是 404 或其他错误。否则,将链接属性复制并粘贴到浏览器并检查 .js 路径是否正确。
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.