Simple & Simple Tabs plug-in code based on Jquery _ jquery

Source: Internet
Author: User
A simple & amp; Tabs plug-in based on Jquery. For more information, see. HTML code

The Code is as follows:



  • 1

  • 2

  • 3



  • First


    Second


    Third




    Jquery

    The Code is as follows:


    $ (). PPXTabs ({nav: '. tab Lil', nav_txt:'. tab_box P', selectedClass: 'selected', hoverClass: 'hover '});


    Jquery. PPXTabs. js Code

    The Code is as follows:


    /* ===================================================== ======================================
    * Copyright 2009 PPX
    * Email: Mr.cuix@Gmail.com
    * Original version Author: PPX Creation Time:
    * ===================================================== ======================================
    * Parameter description
    *Navigation Column
    *Navigation content
    *Selected Style
    *Style when passing
    *
    * The default value is
    * $ (). PPXTabs ({
    Nav: '. news_title1 li ',
    Nav_txt: '. news_list_box P ',
    SelectedClass: 'tab _ partition ',
    HoverClass: 'tab _ partition B'
    });
    ==========================================
    Demo
    -----


  • 1

  • 2

  • 3



  • First


    Second


    Third



    ==========================================
    Css
    -----
    $ (). PPXTabs ({nav: '. tab Lil', nav_txt:'. tab_box P', selectedClass: 'selected', hoverClass: 'hover '});
    */

    $. Fn. PPXTabs = function (options ){
    // Default Configuration
    Var settings = {
    Nav: '. news_title1 li ',
    Nav_txt: '. news_list_box P ',
    SelectedClass: 'tab _ partition ',
    HoverClass: 'tab _ partition B'
    };
    // Main Function
    $ (Function (){
    Var tab_menu_li = $ (settings. nav );
    $ (Settings. nav_txt + ': gt (0)'). hide ();

    Tab_menu_li.hover (function (){
    // Move the cursor in
    $ (This). removeClass (settings. hoverClass );
    $ (This). siblings (). find ("." + settings. selectedClass). removeClass (settings. selectedClass );
    $ (This). siblings ("li"). addClass (settings. hoverClass );
    $ (This). addClass (settings. selectedClass );
    Var index = tab_menu_li.index (this );
    $ (Settings. nav_txt). eq (index). show (). siblings (). hide ();
    }, Function (){
    // Move the mouse out
    $ (This). removeClass (settings. selectedClass );
    $ (This). siblings (). find ("." + settings. selectedClass). removeClass (settings. selectedClass );
    $ (This). siblings ("li"). addClass (settings. hoverClass );
    $ (This). addClass (settings. selectedClass );

    });

    });
    If (options ){
    $. Extend (settings, options );
    }


    };

    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.