views:

46

answers:

1

I am using Jquery's animate() function to animate a div. When i give multiple effects like height 140 and width 200, then what happening is the the next effects starts only after the previous effect finish. I want to execute simultaneously. Plz help. Any help will be appreciated

Code:

        $(document).ready(function(){
            $(".gal_item").hover(function(){                    
                $(this).children().animate({height:110},"medium");
                $(this).children().animate({width:110},"medium");
            });

        });

HTML

            <div class="gal_item"><img src="images/2.jpg" width="120" height="100" /></div>
            <div class="gal_item"><img src="images/3.jpg" width="120" height="100" /></div>
+3  A: 

The animate method accepts multiple style declarations, you can simply...

$(document).ready(function(){
    $(".gal_item").hover(function(){                    
        $(this).children().animate({
            height:110,
            width: 110
        }, "medium");
    });
});
Marko
Thanks mate!, Works Perfect!, +1 and a tickkk.
Rajasekar