URL:
http://qualitygameservers.com.gridhosted.co.uk/
我正在尝试安装此处演示的JQuery灯箱:
https://designshack.net/articles/javascript/create-a-simple-jquery-image-lightbox-gallery/
控制台返回它实际上不是一个函数,但我的脚本体验很少。
任何想法是什么问题?我错过了一些基本的东西,或者这是开源代码的问题吗?
谢谢。
答案 0 :(得分:0)
确保同时获得jquery资源和灯箱代码:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="https://designshack.net/tutorialexamples/lightbox-gallery/js/jquery.lightbox-0.5.min.js">
如果您可能希望在自己的网站上托管该jquery.lightbox文件,以防教学页面被移动/删除。
$(function() {
$('#thumbnails a').lightBox();
});
&#13;
<link href="https://designshack.net/tutorialexamples/lightbox-gallery/css/jquery.lightbox-0.5.css" rel="stylesheet"/>
<link href="https://designshack.net/tutorialexamples/lightbox-gallery/css/styles.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="https://designshack.net/tutorialexamples/lightbox-gallery/js/jquery.lightbox-0.5.min.js"></script>
<div id="thumbnails">
<a href="https://designshack.net/tutorialexamples/lightbox-gallery/images/photos/01-turntable-illustration-graphic.png"><img src="https://designshack.net/tutorialexamples/lightbox-gallery/images/photos/01-turntable-illustration-graphic-thumbnail.png" /></a>
<a href="https://designshack.net/tutorialexamples/lightbox-gallery/images/photos/08-extreme-fish-bowl.png"><img src="https://designshack.net/tutorialexamples/lightbox-gallery/images/photos/08-extreme-fish-bowl-thumbnail.png" /></a>
</div>
&#13;