我在页面上使用jQuery Cycle(完整)插件,在该页面上使用宽度为75%的容器DIV(.content-left),并且在该容器内部使用jQuery Cycle幻灯片放映。该容器内的图像应自动调整。
我用:
JS:
$('.slides').cycle({
fx: 'fade',
containerResize: 1 // default for jquery.cycle.all
});
HTML:
<div id="content">
<div class="content-left">
<div class="slides">
<img src="...">
<img src="...">
<!-- etc. -->
</div>
</div>
<div class="content-right">
some text
</div>
<div class="clear"></div>
</div>
CSS:
#content {
overflow:hidden;
}
#content .content-left {
width:75%;
float:left;
}
#content .content-left img { /* or: .slides img */
width:100% !important;
position:relative;
left:0px;
top:0px;
z-index:-2;
}
#content .content-right {
width:25%;
float:right;
}
在页面初始化中,由于containerResize函数的存在,我的包装DIV的(.content-left)高度和宽度得到了很好的调整。但是,当我调整浏览器窗口的大小时,幻灯片的宽度和高度保持不变,这不是我想要的。
containerResize:0也不带来预期的效果(然后忽略图像的高度,并将包装器的高度调整为.content-right的高度(并剪切图像))。
当我仅使用图像而不加载Cycle时,一切正常。
有什么解决办法吗?
谢谢!
最佳答案
关于jquery-cycle - jQuery Cycle Plugin可扩展DIV和containerResize = 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8588112/