开发者

IE6 position:absolute in relative container resizing

I have this bug in IE6. I've showed it here http://fiddle.jshell.net/bfXGC/2. When you increase height of container, then position of absolute block updates to the bottom of container. When you increase height of inner content, then position of absolute block doesn't updates. How开发者_高级运维 can I fix this behaviour in IE6


Only way i could get this to work is to set the css top value on the absolute div each time you update:

$("div.absolute").css("top", $(".inner").height());

A working example is available here. http://fiddle.jshell.net/bfXGC/14/


You didn't specify if a JavaScript fix is acceptable, but if it is, this works:

$('.absolute').css('position', 'static').css('position', 'absolute');

Yes, that is just reapplying position: absolute. It forces IE6 to recalculate.

See: http://fiddle.jshell.net/bfXGC/15/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜