문제

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;
         }
도움이 되었습니까?

해결책

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

    })
})

다른 팁

Try

window.location.href = $(event.currentTarget).attr('rel');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top