Click functions - making stuff happen
Binding CLICK events
Users interact with webpages by clicking on different elements. jQuery allows us to easily add to, or change the behavior of the links we click on.
If you want to override the functionality of an anchor link, you must return false at the end of the function. Even if your href=#, you will want to return false so the screen doesn't jump!
You can also UNBIND clicks - this is very important if you want to change the click functionality.
To unbind a click, simply use .unbind('click').click( ... )more...
- Adding (or binding) a click
- unbinding the click
- Changing the click
- another way of binding the click
- THIS - accessing the information of the thing you clicked
- Another reason to use return false
- Another way to prevent the default click action
- .click http://api.jquery.com/click/
- .bind http://api.jquery.com/bind/
- .unbind http://api.jquery.com/unbind/
- .preventDefault http://api.jquery.com/event.preventDefault/
- this (lots of info, I like this one: ) http://remysharp.com/2007/04/12/jquerys-this-demystified/