开发者

jQuery IE6 dilemma: animate scrollLeft or left?

I have a few panels that I slide horizontally using the animate function that jQuery so generously provides.

The problem is that 100% of the clients that will be using this small app I am making use IE6. I am wo开发者_高级运维rried that because the panels contain a few elements on them, not too many but not few it will be very slow on IE6 and the rather poor-ish PCs that will be seeing this.

Now the question, should I animate scrollLeft to scroll the parent div or should I reposition the child div animating css left attribute?

Is there any performance gain by chosing one over the other? (I cannot test on the target PCs at the time being to be able to make an empirical decision.)

Thank you.


From my experience, animating scrollLeft gives better performance because most browsers do not redraw the entire window when scrolling (otherwise scrolling down a page would be ridiculously laggy for the slower computers...), while animating the left css property would cause the browser to redraw.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜