here is the code: http://jsfiddle.net/4WyPq/
So basically when I click ‘button1’ it animates then disables the button, after that I need to press button2 and enable the ‘button1’ event so I press again ‘button1’ it should do the same event.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you bind a click event to a link, you HAVE to include the click handler function.
does not do anything because there is no handler function. You would have to pass the click handler function again if you want to rebind it. You could do that by breaking the click handler out into it’s own local function and then using that function each time you bind the click event. You could do that like this:
Working demo here: http://jsfiddle.net/jfriend00/3kjaR/
If you really intend to enable and disable the handlers for links like this, it may be easier to just set a property that you check rather than actually remove the event handlers.
You could use a flag like this:
Working demo here: http://jsfiddle.net/jfriend00/NSZ8P/