本文介绍了不能让jquery.bgswitcher作品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
试图让使用jQuery bgswitcher背景滑块。
我的code
Trying to make a background slider using jquery bgswitcher.My code
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script src="js/jquery.bgswitcher.js"></script>
<script>
$(".wrapper").bgswitcher({
images: ["img/1.jpg", "img/2.png", "img/3.jpg", "img/4.png"],
effect: "fade",
interval: 5000,
loop: false,
shuffle: false,
duration: 5000,
easing: "swing"
});
</script>
我不知道有什么不对的code,但背景滑块不工作!
任何想法?
I don't know what's wrong with this code, but the background slider doesn't work!Any idea?
推荐答案
初始化bgswitcher中的document.ready ...
Initialize the bgswitcher in document.ready...
<script>
$(document).ready(function(){
$(".wrapper").bgswitcher({
images: ["img/1.jpg", "img/2.png", "img/3.jpg", "img/4.png"],
effect: "fade",
interval: 5000,
loop: false,
shuffle: false,
duration: 5000,
easing: "swing"
});
});
</script>
这篇关于不能让jquery.bgswitcher作品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!