Code for implementing Simple tabs plug-in functions in jquery _ jquery-js tutorial

Source: Internet
Author: User
Jquery has changed the way programmers write javascript. As a beginner and fan of jquery, I recently learned to use a few jquery code statements to implement functions similar to the tabs plug-in, I believe this article will help many beginners of jquery and those who want to implement the tabs plug-in function. Let's get down to the truth. Here is the full text.

First, attach two of the simplest ones.

First, write simple HTML code. The UL label used as the tabs and the p label containing the content.

  • Sea sky
  • Glorious years
  • Really love you
For simplicity, I only write three.

Today, I watched the snow float in the cold night. With the cooling of the nest floating far ...... Still self-free, always sing my song, travel thousands of miles.

The bell rings the signal of returning home, and it seems to be a bit of a sigh in his life ...... Self-confidence can change the future and ask who can do it.

A pair of hands that cannot be modified, bringing warmth always behind the scenes ...... Please let me say that I really love you.

No image is needed for all appearances, which is simple and simple, so CSS is used for all appearances. Here I will pick out more important writing.

Li {float: left ;}

A {display: block; border: solid 1px #000 ;}

P {border: solid 1px #000; margin-top =-1px ;}

. Selected {border-bottom-color: # FFF; color: # F00;} // set the border color at the bottom of the selected tab to the same color as the content background.

The most important thing is how to use jquery to implement the tabs function.

The Code is as follows:


Related Article

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.