开发者

Scroll Juddering in IE using Jquery resize function

开发者 https://www.devze.com 2023-04-12 21:44 出处:网络
I am designing a image resizer but when I u开发者_Go百科se the jQuery resize function in IE the Scroll Bars go juddery. http://www.chillwebdesigns.co.uk/test/CB/3/ (Working Example).

I am designing a image resizer but when I u开发者_Go百科se the jQuery resize function in IE the Scroll Bars go juddery. http://www.chillwebdesigns.co.uk/test/CB/3/ (Working Example).

When the page loads it seems to be fine but when the window is resized then maximised the juddering happens on the scroll bar.

This is what i have written so far.

$(function(){

    $(window).load(function() { 

        start();

        $(window).resize(function(){start()});

        function start(){

        $('#CB img').css({height:'auto',width:'auto'});

            $('#CB img').each(function() {   

                var WinH    = $(window).height(),
                    WinW    = $(window).width(),
                    ImgH    = $(this).height(),
                    Padding = 100;


                if(WinH < ImgH){

                $(this).css({height: WinH - Padding, margin:Padding / 2});

                }

                var NewW    = $(this).width();

                if(WinW < NewW){

                $(this).css({width: WinW - Padding, margin:Padding / 2});

                }   

            });

        }

    });

});

Any help or ideas would be helpful.

0

精彩评论

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