Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. $('body').delegate('a.skiplink-accessible-text', 'click', function (e) {
  2. //e.preventDefault();
  3. if (!$.browser.msie) {
  4. e.preventDefault();
  5. }
  6. var jumpTo = $(this).attr('href');
  7. $('body').find(jumpTo).attr('tabindex', - 1).focus();
  8.  
  9. });
  10.  
  11. preventDefault: function() {
  12. this.isDefaultPrevented = returnTrue;
  13.  
  14. var e = this.originalEvent;
  15. if ( !e ) {
  16. return;
  17. }
  18.  
  19. // if preventDefault exists run it on the original event
  20. if ( e.preventDefault ) {
  21. e.preventDefault();
  22.  
  23. // otherwise set the returnValue property of the original event to false (IE)
  24. } else {
  25. e.returnValue = false;
  26. }
  27. },
  28.  
  29. $(document).ready(function(){
  30. $('a').on('click', function(e){
  31. e.preventDefault();
  32. var jumpTo = $(this).attr('href');
  33. $(jumpTo).attr('tabindex', '-1').focus();
  34. });
  35. });
  36.  
  37. $('body').delegate('a', 'click', function(e){ // ...
  38. });
  39.  
  40. $('body').delegate('a.skiplink-accessible-text', 'click', function (e) {
  41.  
  42. if (!$.browser.msie) {
  43. e.preventDefault();
  44. } else {
  45. e.returnValue = false;
  46. }
  47.  
  48. var jumpTo = $(this).attr('href');
  49. $('body').find(jumpTo).attr('tabindex', - 1).focus();
  50.  
  51. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement