开发者

Showing whole DIV in IE (jQuery slider)

开发者 https://www.devze.com 2022-12-22 01:56 出处:网络
IE somehow shows the whole DIV when the page loads before it resizes to the right开发者_运维百科 size. Is it possible to avoid this since it is really ugly?

IE somehow shows the whole DIV when the page loads before it resizes to the right开发者_运维百科 size. Is it possible to avoid this since it is really ugly?

https://stackoverflow.com/users/216925/luuk

In FF it works perfectly fine (not the layout fully, but the slider).


IE's javaScript rendering engine (excluding IE9) is horribly slow, and in IE your DOM/HTML will always be displayed with a slight delay prior to any JS being executed. You need to either set styles via CSS manually or make your div hidden and run it through the process of resize->delay->fadeIn.

CSS:

<style> #yourDiv { visibility:hidden; } </style>

jQuery:

$('#yourDiv').width(...).height(...).delay(100).fadeIn(500);
0

精彩评论

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