开发者

resizing window/div causes div to flicker

I'm pretty sure that I should be using easing for this problem, but not certain how to implement it.

I have the following code:

function resizeBlock() {
    if ($("#blocks").width < 995) {
    $blwidth开发者_StackOverflow = 0;
    }
    else {
    $blwidth = ($("#blocks").width());
    $blwidth = ($blwidth + 60) - 990;
    $("#block-left").width($blwidth);
    }
};
$(window).resize(function(){
resizeBlock();
}

The div #block-left flickers/jumps when resizing the window. How would I use easing to fix this?

MTIA


Have a look at jQuery Animate

$("#block-left").animate({ width: $blwidth });

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜