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.
精彩评论