开发者

jQuery Tab with tab titles as links

I'm using the standard jquery tab functionality and i was wondering if there is any way to make some of the tab headers simply a links that will redirect the user to another pages.

I'm actually want that wh开发者_如何转开发en you hover over the tab you will see: "http://www.mysite.com/mypage" , i.e, the href of the tab header will be a simple link.

please let me know if its doable.

Thanks


Yes you can make links to other pages, not sure if that your question. If you want the user to see the URL when they hover make the title attribute of the link the url, and it will show as a tools tip.

ie:

<a href="http://www.stackoverflow.com" title="http://www.stackoverflow.com">My Tab</a>

If you need help with the tabs themselves, thats too broad. Try using jQuery Tools


Straight from the jQuery UI website:

$('#example').tabs({
    select: function(event, ui) {
        var url = $.data(ui.tab, 'load.tabs');
        if( url ) {
            location.href = url;
            return false;
        }
        return true;
    }
});

When you set up your tabs, make the href attribute a hyperlink instead of using the "#tab" format.

DEMO: http://jsfiddle.net/v2pKQ/2/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜