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!