Click here to Skip to main content
15,922,015 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
When the button is clicked for a second time I want it to go back to its original size, how can I do this?

XML
jQuery(document).ready(function(){

$("button").click(function(){
        var btn =$("button");
        btn.animate({height:'300px'},"slow");
        btn.animate({width:'300px'},"slow");
        btn.animate({height:'100px'},"slow");
        btn.animate({width:'100px'},"slow");
});
});
</script>
</head>

<body>
<button style="height:25px; width:150px">Start Animation

</button>
</body>
Posted
Comments
Member 9581488 15-May-13 9:15am    
http://jqueryui.com/animate/#default the link might give you and idea..!

1 solution

Hi,

Hope this helps you.

http://jsfiddle.net/pvZJ8/[^]

Thank you,
Vamsi
 
Share this answer
 
Comments
Member 8649609 15-May-13 10:09am    
Thanks this works but what is I wanted to add a third click when a different event?
RelicV 15-May-13 10:19am    
Instead of true/false, you can set it to 0 and keep on increasing the count based on the click. Once you get the count, you know what the click is supposed to do. Got the idea..?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900