有人可以帮助我排除在其他部门内的部门。我的目标是试图超越我的孩子div description 来完成 jquery 中的循环。已尝试使用jquery函数不()和子项()! 有什么建议? 这是我的代码:
<script>
$(document).ready(function(){
var images = $(".images");
var backgrounds = new Array(
'url(../img/)'
, 'url(../img/)'
, 'url(../img/)'
, 'url(../img/)'
, 'url(../img/)'
, 'url(../img/)'
, 'url(../img/)'
);
var current = 0;
function nextBackground() {
current++;
current = current % backgrounds.length;
images.fadeOut(3000, function(){
images.css('background-image', backgrounds[current]);
});
images.fadeIn(3000);
}
setInterval(nextBackground, 10000);
images.css('background-image', backgrounds[0]);
images.css('background-repeat', 'no-repeat');
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="background">
<div class="images">
<div class="container layer">
<div class="container description" id="description">
<h4></h4>
<h5></h5>
</div>
</div>
</div>
</div>