New Year's new weather --- present the two JQ results written during work yesterday to the big guy, new weather jq

Source: Internet
Author: User

New Year's new weather --- present the two JQ results written during work yesterday to the big guy, new weather jq

Paste the code first

<Script type = "text/javascript"> var msg = ["", "", ""]; $ (document ). ready (function () {$ ("# tijiao "). click (function () {$ ("# p1" functions .html (msg [Math. floor (Math. random () * msg. length)]) ;};}); </script>

This code is a JQ button that appears at random.

The point is

$ ("# P1" cmd.html (msg [Math. floor (Math. random () * msg. length)]);

Above this sentence.

 

Okay. Next code

 

    <script language="javascript" type="text/javascript">            $(               function() {               $(".content1 ul:gt(0)").hide();               $(".tab li:first").addClass("active");               $(".tab li").css("cursor", "pointer");               $(".tab li").hover(                     function(){                       $(this).addClass("active").siblings().removeClass("active");                       $(".content1 li").eq($(this).index()).siblings().hide().end().show();                                }                                 )                           }             );    </script>    

 

This is the result of a tab switch.

The key point is

In the div block of the tab: Multiple <li> entries are displayed in a float row.
The following corresponds to the contentdiv block: Multiple div,


The first display: block. None.
The number and sequence of elements in the upper and lower div blocks must be consistent.


<Li> bind click.

The corresponding idea is good!

 

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.