Question

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;
         }
Was it helpful?

Solution

Try this out:- http://jsfiddle.net/adiioo7/3fnZ6/2/

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;
         }

    })
})

OTHER TIPS

Try

window.location.href = $(event.currentTarget).attr('rel');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top