if the hide() jquery animate function set after animate(),it doesn't work?

Posted by hh54188 on Stack Overflow See other posts from Stack Overflow or by hh54188
Published on 2011-01-01T11:34:21Z Indexed on 2011/01/01 11:53 UTC
Read the original article Hit count: 201

Filed under:
|
|
|

First I have a animate a iframe which id is "test"

<iframe id="test" src=""></iframe>

then I want animate it and hide it ,make a close effect like in MacOS:

$('#test').animate({
                'width':0,
                'height':0,
                'top':$('input').offset().top,
                'left':$('input').offset().left
            },function(){
                //$(this).hide();        
            }).hide();

but it seems the iframe can not be hide.However,if I write it in the callback function that in animate,which is the annotated code above.It could work again.

Here is online case

So I wonder why the hide() after animate() doesn't work?Do I miss something ?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery