code_junkie

Disable anchors in Chrome/WebKit/Safari

Nov 11th, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. $("a").attr("disabled", "disabled");
  2.  
  3. $("a").click(function(event){
  4. if (this.disabled) {
  5. event.preventDefault();
  6. } else {
  7. // make your AJAX call or whatever else you want
  8. }
  9. });
  10.  
  11. a[disabled=disabled] { cursor: wait; }
Add Comment
Please, Sign In to add comment