jquery - IE7 Jquery 位置 : Relative

标签 jquery html css internet-explorer internet-explorer-7

我正在使用一个需要 position:relative 的插件来为 UL 中的 li 元素设置动画。

这是一个演示:http://jsfiddle.net/bleachie/aJPRp/

在 IE7 中 overflow:hidden 不起作用,但如果从 UL 中删除 position:relative 则起作用;该插件无法正常工作。

我如何在 IE7 中解决这个问题?

谢谢。

CSS

ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.jSlots-wrapper {
    overflow: hidden;
    height: 20px;
    display: inline-block; /* to size correctly, can use float too, or width*/
    border: 1px solid #999;
}

.slot {
    float: left;
}

HTML

<ul class="slot">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li>6</li>
    <li>7</li>
</ul>
<input type="button" id="playNormal" value="play">​

Javascript

 $('.slot').jSlots({
     spinner : '#playNormal',
     winnerNumber : 7
 });

最佳答案

快速搜索找到了这个 question and answer .基本上,要使溢出隐藏在 IE6/IE7 中与相对定位的子项一起使用,您还需要相对定位容器。所以在这种情况下:

.jSlots-wrapper {
    position: relative;
    overflow: hidden;
    height: 20px;
    display: inline-block; /* to size correctly, can use float too, or width*/
    border: 1px solid #999;
}

关于jquery - IE7 Jquery 位置 : Relative,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10786791/

相关文章:

javascript - 禁用输入上的事件

javascript - 使用 Jquery 和 Ajax 的 Accordion 列表

php - 右侧的 div 具有动态高度,而左侧的 div 是固定的 : Side by side needed

javascript - Android文件上传 - 文件名错误, native 浏览器

javascript - 在 <p> 标签中包装拉出的文本

HTML textarea 标签大小改变

php - 用于重定向的 php header

html - Nimbus Sans L 仅在 Firefox 中以上标呈现 TM ...浏览器错误?

html - 初学者 html 问题::如何让水平滚动条出现?他们只是不会.. td 标签中的数据正在移动到下一行

css - React 模态和媒体查询