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