PDA

View Full Version : Resolved jQuery UI TABS - Update URL Hash



crobinson42
06-22-2013, 06:01 PM
This is extremely frustrating! I've tried all browsers and none of them work.

the below code does nothing.



$(function() {
$("#tabs").tabs();
$("#tabs").bind('tabsshow',function(event, ui) {
window.location = ui.tab;
});
});

Neither does this!



$("#tabs").tabs({
show: function(event, ui) {
window.location = ui.tab;
}
});



Any suggestions or input is appreciated.

crobinson42
06-22-2013, 07:14 PM
It's a bug in the UI, here's the solution:


$('#tabs ul li a').click(function () {location.hash = $(this).attr('href');});

jscheuer1
06-23-2013, 04:06 PM
I'm not real familiar with that script. But I imagine the results depend upon one's intent and how the tabs are setup. As long as your solution works for you, that's fine. But it might not actually be a bug. Could be though.