Moving an element on multiple clicks ?
Basically I would like to create a button that moves a div to a place then it stops until I click on it again and it move somewhere else. How do I do that ?
This is what I have and it only moves the div once. I want to click a second time and the block goes down. (I'm just trying to move a simple square on a page using a buttin with jquery to learn.)
- <script>
- $(document).ready(function(){
- $("button").click(function(){
- $("#div1").animate({left:'250px'});
- });
- });
- </script>