Jquery - 使用IE进行CSS翻译 [英] Jquery - CSS translation with IE
问题描述
我希望使用JQuery将其父divregister_tile内的div称为register_bottom_bar,向上翻译174像素。我让它在Chrome和Firefox中完美运行。
I want to translate the div called "register_bottom_bar" inside its parent div "register_tile" by 174 pixels upwards using JQuery. I got it to work perfectly in Chrome and Firefox.
我如何在IE中做同样的事情?我在IE 8上测试它。
How can I do the same in IE? I'm testing it on IE 8.
register_tile是一个更大div内的浮动div,register_bottom_bar位于register_tile的底部,位置为:相对。
"register_tile" is a floating div inside a bigger div and "register_bottom_bar" lies at the bottom of "register_tile" with position: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)');
});
推荐答案
如果你需要支持旧版IE(6) ,7,你需要使用属性保证金/头寸。
if you need support for old version of IE (6, 7, 8) you'll need to play with the properties margin / position instead.
$('.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);
});
这篇关于Jquery - 使用IE进行CSS翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!