**好吧,所以不要杀了我,我是jquery和bxsliders的新手,但是我即将解决这个问题并需要一个救世主。我认为我的所有文件都在正确的位置......我只是想不出来。
简单问题:尝试让滑块工作:**
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="http://bxslider.com/lib/jquery.bxslider.css" rel="stylesheet" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://bxslider.com/lib/jquery.bxslider.js"></script>
</head>
<body>
<div class="container">
<script type="text/javascript">
$(document).ready(function(){
$('slider1').bxSlider();
$('slider2').bxSlider();
});
</script>
<div class="sliders">
<h3>Slideshow 1</h3>
<ul id="slider1">
<li><img src="images/JT.jpg" /></li>
<li><img src="images/RW.jpg" /></li>
<li><img src="images/WJ.jpg" /></li>
<li><img src="images/DF.jpg" /></li>
<li><img src="images/BE.jpg" /></li>
<li><img src="images/JH.jpg" /></li>
</ul>
<h3>Slideshow 2</h3>
<ul id="slider2">
<li><img src="images/JT.jpg" /></li>
<li><img src="images/RW.jpg" /></li>
<li><img src="images/WJ.jpg" /></li>
<li><img src="images/DF.jpg" /></li>
<li><img src="images/BE.jpg" /></li>
<li><img src="images/JH.jpg" /></li>
</ul>
</div>
</div>
</body>
</html>
答案 0 :(得分:1)
阅读文档# id-selector
$(document).ready(function () {
$('#slider1').bxSlider();
^ // added # tag for id-selector
$('#slider2').bxSlider();
^ // added # tag for id-selector
});