Reputation: 823
I am seeking to linka jquery ui tab to an external link, I have tried to work it around but havent been able to accomplish this, I used select event earlier to make it work but after the 1.10 upgrade the old code i have isnt working
Here is what I have done, What I am doing is on beforeActivate I am using event object to narrow down to the anchor tag's rel and use that for redirect This is where I am http://jsfiddle.net/rigids/3fnZ6/ and donot think I am going in right directeion
beforeActivate: function (event, ui) {
event.preventDefault();
//console.log(event);
window.location.href = event.currentTarget.attributes[0].nodeValue;
}
Upvotes: 0
Views: 100
Reputation: 9612
JS:-
jQuery(document).ready(function(){
jQuery( "#tabs" ).tabs({
beforeActivate: function (event, ui) {
if(event.currentTarget.rel)
window.location.href = event.currentTarget.rel;
else
window.location.href = event.currentTarget.href;
}
})
})
Upvotes: 2
Reputation: 388316
Try
window.location.href = $(event.currentTarget).attr('rel');
Upvotes: 1