Posted By

terrencewood on 08/30/10


Tagged

javascript html jquery


Versions (?)

Make fragment identifiers work with base


 / Published in: JavaScript
 

  1. /**
  2.  * Make fragment identifiers work with base
  3.  */
  4. jQuery(function($) {
  5. $("a[href^=#]").click(function(e) {
  6. e.preventDefault();
  7. window.location.hash = this.href.substr(this.href.indexOf("#") + 1);
  8. });
  9. });
  10.  
  11.  
  12.  
  13.  
  14. /**
  15.  * Make fragment identifiers work with base and jqueryui-tabs
  16.  */
  17. jQuery(function($) {
  18. $("a[href^=#]").not(".ui-tabs-nav a").click(function(e) {
  19. e.preventDefault();
  20. window.location.hash = this.href.substr(this.href.indexOf("#") + 1);
  21. })
  22. });

Report this snippet  

You need to login to post a comment.