我想使用JQuery将父div "register_tile“中的名为"register_bottom_bar”的div向上转换174像素。我让它在Chrome和Firefox上完美地工作。
如何在IE中执行相同的操作?我正在IE8上测试它。
"register_tile“是一个更大的div中的一个浮动div,"register_bottom_bar”位于"register_tile“的底部,位置:relative。
$('.register_tile').click(function () {
$(this).css('opacity', '1');
$(this).css('background-image', 'none');
$('.register_bottom_bar').css('-webkit-transform', 'translate(0,-174px)');
$('.register_bottom_bar').css('-moz-transform', 'translate(0,-174px)');
});发布于 2012-12-12 14:41:22
如果你需要对旧版本的IE (6,7,8)的支持,你需要使用属性margin / position来代替。
$('.register_tile').click(function () {
$(this).css('opacity', '1');
$(this).css('background-image', 'none');
$('.register_bottom_bar').css('left', '-174px); // With absolute / relative positioning
// OR
$('.register_bottom_bar').css('margin-left', '-174px);
});发布于 2012-12-12 14:25:49
在旧版本的IE中没有任何类型的过渡效果。( IE8不支持CSS3 transforms)
据我所知,唯一接近它的方法是使用JQuery的fadeIn()和fadeOut()方法
您需要为ie9使用-ms-transform
css(' -ms-transform', 'translate(0,-174px)');-ms-transform: translate(50px,100px); /* IE 9 */
-webkit-transform: translate(50px,100px); /* Safari and Chrome */
-o-transform: translate(50px,100px); /* Opera */
-moz-transform: translate(50px,100px); /* Firefox */https://stackoverflow.com/questions/13833934
复制相似问题