0

I am using jquery ui tabs and I would like to be able to add the id of the tabs href to the url in the address bar.

I.e instead of having the below url all the time when clicking through tabs

http://satbulsara.com/rspca/dog-page.html

I would like to be able to have

http://satbulsara.com/rspca/dog-page.html#tab1

or #tab2 or #tab3 etc depending on which tab has been clicked.

This is the html default behaviour but ui tabs seems to take it out

below is a url

http://satbulsara.com/rspca/dog-page.htm

sat
  • 1,009
  • 3
  • 19
  • 41
  • 1
    I think you are looking for something like the following? http://stackoverflow.com/questions/570276/changing-location-hash-with-jquery-ui-tabs – jeffreydev Sep 12 '11 at 13:21

2 Answers2

0

I achieved it this way. This might be helpful because tabs display results when someone clicks on them.

jQuery(".ui-tabs-anchor").click(function(e){
    window.location.hash = jQuery(this).attr("href");
});
Zaheer Abbas
  • 145
  • 3
  • 13
0

You can set it yourself when you implement your own:

window.location.hash = "foo";
Adam Terlson
  • 12,610
  • 4
  • 42
  • 63
  • how would Implement the default html behavour of the url changing to mathc the href of the tab thats been clicked – sat Sep 12 '11 at 13:20
  • 1
    By following what they say here: http://stackoverflow.com/questions/570276/changing-location-hash-with-jquery-ui-tabs, assuming you are actually using jQuery UI tabs. – Adam Terlson Sep 12 '11 at 13:24