开发者

jQuery - animate width problem when resizing window

I'm using jQuery to hide and show a series of DIVs on a page on an image press. I'm seeing problems when I hide the area then resize the browser window (Firefox 5 Windows XP). When I go to show the elements again, only the second half of them are开发者_如何学编程 animated display. If I resize my window manually, it displays correctly again. Here is a code snippet:

$("#imgToggle").click( function ( event ) {
   var isVis = ($("#container1").is(":visible") );

    $("#container1").animate( {width: 'toggle'} );            
    $("#container2").animate( {width: 'toggle'} ); 
 
    if ( isVis )
    {
       $("#leftPanel").css( "z-index" , "5" );
    }
    else
    {
       $("#leftPanel").css( "z-index" , "" );
       
    }

});

I have tried using a window.resizeTo(currentWidth, currentHeight) after all of this but, it did not work. Any thoughts, ideas?

Thanks in advance.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜