我想在我的网页上添加backstretch,作为图片幻灯片显示(body
背景)
但它不起作用!!
我使用的唯一代码是这一个:(我在</head>
之前添加了它)
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
/*
* Here is an example of how to use Backstretch as a slideshow.
* Just pass in an array of images, and optionally a duration and fade value.
*/
// Duration is the amount of time in between slides,
// and fade is value that determines how quickly the next image will fade in
$.backstretch([
"http://dl.dropbox.com/u/515046/www/outside.jpg"
, "http://dl.dropbox.com/u/515046/www/garfield-interior.jpg"
, "http://dl.dropbox.com/u/515046/www/cheers.jpg"
], {duration: 3000, fade: 750});
</script>
这里有什么问题?谢谢:))
答案 0 :(得分:0)
Backstretch不是默认jquery库的一部分。你有没有单独加载它?
我已在此代码段中完成了此操作,您的代码似乎有效:
$.backstretch([
"http://dl.dropbox.com/u/515046/www/outside.jpg"
, "http://dl.dropbox.com/u/515046/www/garfield-interior.jpg"
, "http://dl.dropbox.com/u/515046/www/cheers.jpg"
], {duration: 3000, fade: 750});
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-backstretch/2.0.3/jquery.backstretch.min.js"></script>
&#13;