Jquery tab plug-in

Source: Internet
Author: User

This article provides two jquery tab switch tabs implemented by using the jquery tab plug-in. With jquery, it is much easier to switch menus.

This article provides two jquery tab switch tabs implemented by using the jquery tab plug-in. With jquery, it is much easier to switch menus. /* Simple tab plug-in */

; (Function ($ ){
$. Fn. tabsimple = function (c ){
C = $. extend ({
Tab: ". s-tab", // Title item
Con: ". s-con", // content item
Curr: "curr", // name of the currently highlighted css tutorial class
Event: "click" // triggered event. All events supported by jquery
}, C );
Return this. each (function (){
Var tab = $ (this). find (c. tab );
Var con = $ (this). find (c. con );
Tab. bind (c. event, function (){
Var I = tab. index ($ (this ));
Tab. removeclass (c. curr); // or tab. find ("." + c. curr). removeclass (c. curr)
$ (This). addclass (c. curr );
Con. hide (). eq (I). show ();
});
});
};
}) (Jquery );


File Code 2

<Div id = "tt" class = "tabs-container" style = "width: 500px; height: 150px;">
<Div title = "tab1" style = "padding: 20px; display: none;"> this is tab1. </div>
<Div title = "tab2" closable = "true" style = "padding: 20px; display: none;"> this is tab2 width close button. </div>
<Div title = "tab3" icon = "icon-reload" closable = "true" style = "padding: 20px; display: none;"> this is tab3 width icon. </div>
<Div title = "tab4 with iframe" closable = "true" style = "width: 100%; height: 100%; display: none;">
<Iframe scrolling = "yes" frameborder = "0" src = http://www.bKjia. c0m style = "width: 100%; height: 100%;"> </iframe>
</Div>
<Div title = "tab5 with sub tabs" closable = "true" icon = "icon-cut" style = "padding: 10px; display: none;">
<Div class = "tabs-container" style = "height1: 100px; width: 100%;">
<Div title = "Sub-title 1"> sub-content 1 </div>
<Div title = "Sub-title 2"> sub-content 2 </div>
<Div title = "subtitle 3"> subtitle 3 </div>
</Div>
</Div>
</Div>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.