Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <li><a href="#">Current Period</a>
  2. <ul>
  3. <li><a href="#">2012</a>
  4. <li> a href="#">2011</a> //...you get the point
  5.  
  6. <li><a href="#" class="noclick">Current Period</a> ....
  7.  
  8. $("#nav a").click(function(e){
  9. if ($(e.target).hasClass("noclick"))
  10. return false;
  11.  
  12. // your other code here
  13. });
  14.  
  15. $("#nav a").not(".noclick").click(function() { ...
  16.  
  17. $('.noclick').unbind('click');
  18.  
  19. $('.noclick').click(function(e){e.preventDefault();});
  20.  
  21. <a href="javascript:void(0);">Text</a>
  22.  
  23. ('.noclick').on('click' , function(e) {
  24. e.preventDefault();
  25. });
  26.  
  27. <li><a href="#" class="noclick">Current Period</a> ....
  28.  
  29. <li><a href="#" class="noclick" onclick="return false;">Current Period</a> ....
  30.  
  31. .noclick { pointer-events: none; cursor: default; }
  32.  
  33. .noclick { cursor: default; }
  34.  
  35. .noclick { cursor: default; }
  36.  
  37. $('.noclick').each(function() {
  38. var $this = $(this);
  39. $this.hover(function() {
  40. // do something...
  41. });
  42. $this.click(function() {
  43. return false;
  44. });
  45. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement