【发布时间】:2013-09-29 22:45:08
【问题描述】:
我在 IE 6 和 7 中遇到了一个问题,即在水平可滚动 div 中嵌入了 Cycle 幻灯片。我已经使用这种技术(http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div)来创建水平可滚动的 div。我会将 Cycle 幻灯片嵌入到可滚动的 div 中。在 FF3、Opera、Chrome 中都可以正常工作。在 IE 6 和 7 中,图像容器和导航缩略图是固定的,它们不会滚动。可滚动 div 中的所有其他 div 或元素都可以正常工作。
这是我的代码:
<div id="content">
<div id="contentscroll">
<div id="contentholder">
<div class="contentitem">
<span class="name">ABC</span>
<span class="price">25 €</span>
<div class="photo">
<img src="642_03_prod[1].png" height="280" width="280" />
<img src="855_02_prod[1].png" height="280" width="280" />
<img src="856_01_prod[1].png" height="280" width="280" />
</div>
<ul class="colors">
<li><a href="#"><img src="642_03_prod[1].png" height="25" width="25" /></a></li>
<li><a href="#"><img src="855_02_prod[1].png" height="25" width="25" /></a></li>
<li><a href="#"><img src="856_01_prod[1].png" height="25" width="25" /></a></li>
</ul>
</div>
<!--- other contentitem --->
</div> <!--- end contentholder --->
</div> <!--- end contentscroll --->
</div> <!--- end content --->
这是 CSS:
#contentscroll {
background: transparent;
width: 990px;
height: 386px;
overflow: hidden;
}
#contentholder {
width: 1500px;
height: 386px;
}
.contentitem {
width: 330px;
height: 100%;
padding: 0;
float: left;
}
.contentitem .name, .contentitem .price {
width: 330px;
height: 18px;
margin:0;
padding: 0;
float: left;
text-align:center;
font:12px Arial, Helvetica, sans-serif;
color: #FFF;
}
.photo{
height: 280px;
}
ul.colors { margin:0; padding:0; height: 18px;}
ul.colors { list-style-type: none; display: inline; margin:0; padding:0; }
ul.colors li { background: none; display: inline; margin: 0; padding: 0; }
ul.colors li a { background: none; border: 0; margin: 0; margin-right: 2px; padding:0; color: #FFF;}
ul.colors li a img { background: none; border: 0; margin: 0; padding:0; }
这是JS:
$('.photo').cycle({
fx: 'turnDown',
speed: 'fast',
timeout: 0,
pager: '.colors',
fastOnEvent: true,
slideExpr: null,
cleartype: true,
cleartypeNoBg: true,
pagerAnchorBuilder: function(idx, slide) {
// return selector string for existing anchor
return '.colors li:eq(' + idx + ') a';
}
});
谁能帮帮我? Cycle 是否将 CSS 属性应用于 .photo 和 .colors 并且这个事实造成了这个问题? .name span e .price span 滚动。
【问题讨论】:
标签: jquery