Random color and font size of random and colorful tag tags implemented by jquery

Source: Internet
Author: User

Jquery random and colorful tag random color and font size effect

Js Code:
Copy codeThe Code is as follows:
<Script type = "text/javascript" src = "jquery-1.6.4.js"> </script>
<Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type = "text/javascript"> </script>
<Script type = "text/javascript">
$ (Document). ready (function (){
Var tags_a =$ ("# tags ");
Tags_a.each (function (){
Var x = 9;
Var y = 0;
Var rand = parseInt (Math. random () * (x-y + 1) + y );
$ (This). addClass ("tags" + rand );
});
})
</Script>

Html code:
Copy codeThe Code is as follows:
<Html>
<Head>
<Style>
Body, a {font-size: 13px ;}
A {color: #333333; text-decoration: none ;}
. Taglist {width: 250px; overflow: hidden; border: # dddddddd solid 1px ;}
. Taglist. tit {width: 100%; height: 24px; line-height: 24px; background-color: #565662 ;}
. Taglist. tit a {padding-left: 8px; color: # ffffff ;}
# Tags a {height: 26px; line-height: 26px; padding-right: 6px ;}
# Tags. tags0 {}
# Tags. tags1 {color: # C00; font-size: 24px ;}
# Tags. tags2 {color: #030; font-size: 16px ;}
# Tags. tags3 {color: # 00F ;}
# Tags. tags4 {font-size: 16px ;}
# Tags. tags5 {color: # C00; font-size: 20px ;}
# Tags. tags6 {color: # F06 font-size: 20px ;}
# Tags. tags7 {color: #030; font-weight: bold; font-size: 18px ;}
# Tags. tags8 {color: # F06; font-weight: bold ;}
# Tags. tags9 {color: # C00; font-weight: bold; font-size: 16px ;}
# Tags a: hover {color: # F00; text-decoration: underline ;}
. W95 {width: 95%; margin: 0 auto; padding-top: 6px; padding-bottom: 6px ;}
. Taglist. w95 {}
</Style>
</Head>
<Body>
<Div class = "taglist">
<Div class = "tit"> <a href = "#"> TAG </a> </div>
<Div class = "w95" id = "tags">
<A href = 'HTTP: // www.51xuediannao.com/js/nav/'> navigation menu </a>
<A href = 'HTTP: // www.51xuediannao.com/js/slide/'> focus slide </a>
<A href = 'HTTP: // www.51xuediannao.com/js/gg/'> ad code </a>
<A href = 'HTTP: // www.51xuediannao.com/js/texiao/'> webpage effects </a>
<A href = 'HTTP: // www.51xuediannao.com/js/'> jquery special effect </a>
<A href = 'HTTP: // www.51xuediannao.com/js/gundong/'> rolling code </a>
<A href = "http://www.51xuediannao.com/tags.php? /% E6 % 9F % A5 % E7 % 9C % 8B % E6 % BA % 90% E7 % A0 % 81/"> View Source Code </a>
<A href = "http://www.51xuediannao.com/tags.php? /IE7% E5 % 8F % 98% E6 % 85% A2/"> IE7 slowdown </a>
<A href = "http://www.51xuediannao.com/tags.php? /ET2.0% E9 % 87% 87% E9 % 9B % 86/"> ET2.0 collection </a>
<A href = "http://www.51xuediannao.com/tags.php? /CSS/"> CSS </a>
<A href = "http://www.51xuediannao.com/tags.php? /Moss2007/"> moss2007 </a>
<A href = "http://www.51xuediannao.com/tags.php? /MOSS % E6 % AF % 8D % E7 % 89% 88% E9 % A1 % B5/"> MOSS master page </a>
<A href = "http://www.51xuediannao.com/tags.php? /JS % 2 BCSS % E5 % B9 % BB % E7 % 81% AF % E7 % 89% 87/"> JS + CSS slides </a>
<A href = "http://www.51xuediannao.com/tags.php? /% E7 % BD % 91% E9 % A1 % B5 % E6 % BA % 90% E7 % A0 % 81/"> webpage Source Code </a>
<A href = "http://www.51xuediannao.com/tags.php? /% E7 % BD % 91% E9 % A1 % B5 % E9 % 85% 8D % E8 % 89% B2/"> webpage color </a>
<A href = "http://www.51xuediannao.com/tags.php? /301% E9 % 87% 8D % E5 % AE % 9A % E5 % 90% 91/"> 301 redirection </a>
<A href = "http://www.51xuediannao.com/tags.php? /JS % 2 BCSS % E5 % 88% 97% E8 % A1 % A8/"> JS + CSS list </a>
<A href = "http://www.51xuediannao.com/tags.php? /% E9 % 9A % 8F % E6 % 9C % BA % E6 % 95% B0/"> random number </a>
<A href = "http://www.51xuediannao.com/tags.php? /% E4 % B8 % 8B % E6 % 8B % 89% E8 % 8F % 9C % E5 % 8D % 95/"> drop-down menu </a>
</Div>
</Div>
</Body>
</Html>

Effect display:
 

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.