【发布时间】:2013-03-27 20:56:27
【问题描述】:
我有一个 jQuery 图像滚动器,它使用 perpective 和 transform: translateZ CSS 属性来模拟深度。它在 Chrome 中正确呈现,但在 IE10 或 Firefox 中不正确。
这是完整的项目(单击“谁来”菜单链接查看图像滚动条): http://www.girlguiding.org.uk/test/biggig/index.html 这是相关代码的jsFiddle: http://jsfiddle.net/moosefetcher/rxCMr/28/ (我不知道为什么,但是stackoverflow告诉我我需要包含链接到jsFiddle的代码,所以这里是css)......
.scroller {
position: relative;
perspective: 150;
-webkit-perspective: 150;
-ms-perspective: 150;
-moz-perspective: 150;
}
.artistBox {
width: 228px;
height: 268px;
background-color: #000000;
border-radius: 16px;
position: absolute;
overflow: hidden;
z-index: 4;
}
.artistBox p {
position: absolute;
font-family:"Arial", sans-serif;
color: white;
font-size: 22px;
}
.artistBoxFront {
z-index: 5;
}
.artistBoxNew {
z-index: 3;
opacity: 0;
}
.scrollerButton {
position: absolute;
top: 128px;
width: 32px;
height: 32px;
border: 2px solid white;
border-radius: 32px;
background-color: #F49D19;
box-shadow: 1px 1px 3px #555588;
z-index: 6;
}
.scrollerButtonOver {
background-color: #ffaa26;
box-shadow: 2px 2px 3px #555588;
}
请注意,我已经尝试过包括和排除属性上的 -ms- 前缀。 (当前的 jsFiddle 包括两者,以及 -webkit- 和 -moz-)。
任何人都知道为什么这在 IE10 中可能不起作用?
干杯。
【问题讨论】:
-
不知道这是否算作“颠簸”,但我刚刚发现 IE10 在开发人员工具的“怪癖”模式选项中正确渲染了上述 3D。有谁知道为什么会这样?如果这是一个有用的启示?
-
quirks 模式下的 IE10 不太符合标准。它可能允许没有所需长度单位的长度值(默认情况下假设为
px)。
标签: css firefox transform internet-explorer-10 perspective