去掉 html 中第 15 行多余的 script 标签。
更新1:
更改$('#slider').nivoSlider();
为$('#slider').nivoSlider({
如下所示。
$(document).ready(function() {
$('#slider').nivoSlider({
effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
slices:15,
animSpeed:600, //Slide transition speed
pauseTime:8000,
startSlide:0, //Set starting Slide (0 index)
directionNav:true, //Next & Prev
directionNavHide:true, //Only show on hover
controlNav:true, //1,2,3...
controlNavThumbs:false, //Use thumbnails for Control Nav
controlNavThumbsFromRel:false, //Use image rel for thumbs
controlNavThumbsSearch: '.jpg', //Replace this with...
controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
keyboardNav:true, //Use left & right arrows
pauseOnHover:false, //Stop animation while hovering
manualAdvance:false, //Force manual transitions
captionOpacity:0.8, //Universal caption opacity
beforeChange: function(){},
afterChange: function(){},
slideshowEnd: function(){}, //Triggers after all slides have been shown
lastSlide: function(){}, //Triggers when last slide is shown
afterLoad: function(){} //Triggers when slider has loaded
});
});
更新 2:
好的,所以您在 375 行的 html 中包含了最新版本的 jQuery。请在此行之后粘贴您的 Nivoslider。那就是在第 375 行之后移动以下脚本,比如在</body>
标记之前。
<script type="text/javascript" src="http://www.codtelevision.com/nivo/js/jquery.nivo.slider.pack.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#slider').nivoSlider({
effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
slices:15,
animSpeed:600, //Slide transition speed
pauseTime:8000,
startSlide:0, //Set starting Slide (0 index)
directionNav:true, //Next & Prev
directionNavHide:true, //Only show on hover
controlNav:true, //1,2,3...
controlNavThumbs:false, //Use thumbnails for Control Nav
controlNavThumbsFromRel:false, //Use image rel for thumbs
controlNavThumbsSearch: '.jpg', //Replace this with...
controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
keyboardNav:true, //Use left & right arrows
pauseOnHover:false, //Stop animation while hovering
manualAdvance:false, //Force manual transitions
captionOpacity:0.8, //Universal caption opacity
beforeChange: function(){},
afterChange: function(){},
slideshowEnd: function(){}, //Triggers after all slides have been shown
lastSlide: function(){}, //Triggers when last slide is shown
afterLoad: function(){} //Triggers when slider has loaded
});
});
更新 3:
或者,您可以在开头包含最新版本并消除冲突。因此,将第 13 行中的 jquery 更新为最新的 src http://code.jquery.com/jquery-latest.js
,并将$(window).load(function() {
第 17 行中的$(document).ready(function() {
. 它会起作用的。