jQuery / Cycle / Background图像

时间:2013-11-14 18:17:16

标签: jquery css cycle

我试图让jQuery Cycle处理多个背景图片,但我不确定它为什么不起作用。我根本没有出现任何图像。

我在这里有一个小提琴示例代码:

http://jsfiddle.net/6kjA6/1/

$(document).ready(function() {

    $('#headerRotate').cycle({
        fx: 'fade',
        timeout: 2000
    });
});

<div id="headerRotate">
    <div style="background:url('http://www.lilaclaneequestrian.com/_uploads/headers/692316_image-2.jpeg') no-repeat left top; height: 550px; background-size: 100%;"></div>
    <div style="background:url('http://www.lilaclaneequestrian.com/_uploads/headers/23874_image-4.jpeg') no-repeat left top; height: 550px; background-size: 100%;"></div>
</div>

1 个答案:

答案 0 :(得分:2)

在div上设置一些CSS可以解决它:http://jsfiddle.net/6kjA6/5/

#headerRotate { width: 100%; }    
#headerRotate div { width: 100%; }