<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>图片灯箱--lightBox</title> <script src="js/jquery-1.11.3.min.js"></script> <script type="text/javascript" src="http://www.imooc.com/data/jquery.notesforlightbox.js"></script> <link rel="stylesheet" type="text/css" href="http://www.imooc.com/data/jquery.notesforlightbox.css" /> <link rel="stylesheet" href="css/lightBox.css" /> </head> <body> <div id="divtest"> <div class="title"> <span class="fl">我的相册</span> </div> <div class="content"> <div class="divPics"> <ul> <li><a href="images/Hydrangeas.jpg" title="第一页图片"> <img src="images/Hydrangeas.jpg" /> </a></li> <li><a href="images/Jellyfish.jpg" title="第二页"> <img src="images/Jellyfish.jpg" /> </a></li> <li><a href="images/Koala.jpg" title="第三页"> <img src="images/Koala.jpg" /> </a></li> </ul> </div> </div> </div> </body> </html> <script> $(function(){ $(".divPics a").lightBox({ overlayBgColor:"pink",//图片浏览时的背景色 overlayOpacity:0.4,//背景色的透明度 containerResizeSpeed:300//图片切换时的速度 }); }); </script>
<link rel="stylesheet" type="text/css" href="http://www.imooc.com/data/jquery.notesforlightbox.css" />
<script type="text/javascript" src="http://www.imooc.com/data/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="http://www.imooc.com/data/jquery.notesforlightbox.js"></script>
用这3个库试一下,我这边可以
$(".divPics a").lightBox({
加上这行代码也不行
我的不能自动播放怎么回事 求指教
<!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>
<title>图片灯箱插件</title>
<link rel="stylesheet" type="text/css" href="http://www.imooc.com/data/jquery.notesforlightbox.css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://www.imooc.com/data/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="http://www.imooc.com/data/jquery.notesforlightbox.js"></script>
</head>
<body>
<div id="divtest">
<div class="title">
<span class="fl">我的相册</span>
</div>
<div class="content">
<div class="divPics">
<ul>
<li><a href="http://img.mukewang.com/52e489f20001ecfc04480275.jpg" title="第1篇风景图片">
<img src="http://img.mukewang.com/52e489f20001ecfc04480275.jpg" alt="" />
</a></li>
<li><a href="http://img.mukewang.com/52e48a1e0001eec804480275.jpg" title="第2篇风景图片">
<img src="http://img.mukewang.com/52e48a1e0001eec804480275.jpg" alt="" />
</a></li>
<li><a href="http://img.mukewang.com/52e48a4c00015ad204480275.jpg" title="第3篇风景图片">
<img src="http://img.mukewang.com/52e48a4c00015ad204480275.jpg" alt="" />
</a></li>
</ul>
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
?
overlayBgColor: "#666", //图片浏览时的背景色
overlayOpacity: 0.5, //背景色的透明度
containerResizeSpeed: 600 //图片切换时的速度
})
});
</script>
</body>
</html>
jq版本换成1.8.2就可以,写成1.11.3为什么就不行呢