In jQuery, when you handle the click event, return false to stop the link from responding the usual way prevent the default action, which is to visit the href
attribute, from taking place (per PoweRoy's comment and Erik's answer):
$('a.someclass').click(function(e) { // Special stuff to do when this link is clicked... // Cancel the default action e.preventDefault(); });
Read full article from javascript - How to prevent a click on a '#' link from jumping to top of page in jQuery - Stack Overflow
No comments:
Post a Comment