I\'m using JQuery UI to make tabs in my application. I needed the tabs to be linkable (direct link that opens the page and selects the correct tab). This is done by using a
I tried @mottie solution but is not working now (2 years after).
It triggers an error: TypeError: tabs is undefined.
Following is an acceptable solution for me:
// preventing scroll
// $("#tabs li a[href^='#tab']").bind('click',function(e){ // less general but better
$("#tabs li a").bind('click',function(e){
$("html, body").animate({ scrollTop: 0 });
});