【发布时间】:2016-02-09 09:59:19
【问题描述】:
所以我试图让这个褪色的背景动画在网页上永远持续下去。我该怎么做?代码如下:
$( document ).ready(function() {
// Changing the background js code
console.log('File Loaded! DELETE!!!');
animate();
});
function animate() {
window.setInterval(function(){
window.setTimeout(function(){
$('.content').css('background-image','url(http://crondon.guko.co.uk/wp-content/uploads/2015/11/confetti.jpg)');$('.content').css('transition','background 1s linear');$('.content').css('-webkit-transition','background 1s linear');$('.content').css('-moz-transition','background 1s linear');$('.content').css('-o-transition','background 1s linear');
},3000);
$('.content').css('background-image','url(http://crondon.guko.co.uk/wp-content/uploads/2015/11/bride_groom_baronial_hall1.jpg)');$('.content').css('transition','background 1s linear');$('.content').css('-webkit-transition','background 1s linear');$('.content').css('-moz-transition','background 1s linear');$('.content').css('-o-transition','background 1s linear');
},3000);
animate();
}
【问题讨论】:
-
(这已被再次询问,因此作为后面问题的副本关闭)。
标签: javascript jquery