Bookmarking tabs and retaining url in jquery
<p>I've look around but cant get my tabs to retain their #value in the url. I've got the parameters to pass to the url ie. /index.htm#tab_1, /index.htm#tab_2 etc.. but i cant directly open the tab content when typing in the url in another window. here's my code</p>

<p>html:</p>

<pre><code>&lt;div class="tariffs"&gt;
&lt;h3&gt;Competitions&lt;/h3&gt;
&lt;p&gt;See all of our latest competitions&lt;/p&gt;
&lt;ul class="links"&gt;
&lt;li&gt;&lt;a href="#tariff_1"&gt;Show offers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div class="tariff_content" id="tariff_1"&gt;
&lt;div class="eg_tariffs"&gt;
&lt;div class="product_details"&gt;
&lt;h4&gt;Heading&lt;/h4&gt;
&lt;p&gt;my content&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;



&lt;script type="text/javascript"&gt;
$(document).ready(function () {

$(".tariff_content").hide(); //Hide all content
$(".tariffs:first").addClass("active").show(); //Activate first tab
$(".tariff_content:first").show(); //Show first tab content

//On Click Event
$(".tariffs").click(function () {

$(".tariffs").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tariff_content").hide(); //Hide all tab content

var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active ID content

tabSelect = document.location.hash.substr(1,document.location.hash.length);
$("ul.links li a").tabs('select',tabSelect-1);
$("ul.links li a").bind('tabsselect', function(event, ui) {
window.location.href=ui.tab;
});

return false;
});

});
</code></pre>

<p></p>
