Js lights up the js Code for star rating and getting parameters, and lights up js

Source: Internet
Author: User

Js lights up the js Code for star rating and getting parameters, and lights up js

The image used is as follows:

Online Demo address: http://demo.jb51.net/js/2014/jsxxdf/demo2.html

Complete code:

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml"> <pead> <meta http-equiv =" content-type "content =" text/html; charset = gb2312 "> <meta name =" keywords "content =" webmaster, webpage special effects, webpage special effects code, js special effects, js scripts, scripts, advertising code, webmaster special effects network "/> <meta name =" description "content =" www.zzjs.net, a helper house, essential js special effects and advertisement code for webmasters. A large number of high-quality js special effects, high-quality AD code downloads, all in the house of help "/> <title> webpage special effects add behavior star rating effect helper home welcome you. </title> <style type = "text/css"> <! -- Body {font-size: 12px;} ul {padding: 0; margin: 0 ;}. star_rating {list-style: none; margin:-1px 0 0-1px; padding: 0; width: 70px; height: 12px; position: relative; background: url (http://demo.jb51.net/demoimg/rating_stars.gif) 0 0 repeat-x; overflow: hidden; font-size: 0 ;}. star_rating li {padding: 0; margin: 0; float: left ;}. star_rating li a {display: block; width: 14px; height: 12px; text-decoration: none; text-indent:-9000px; Z-index: 20; position: absolute; padding: 0; margin: 0 ;}. star_rating li a: hover {background: url (http://demo.jb51.net/demoimg/rating_stars.gif) 0 12px; z-index: 2; left: 0 ;}. star_rating. one_star {left: 0 ;}. star_rating. one_star: hover {width: 14px ;}. star_rating. two_stars {left: 14px ;}. star_rating. two_stars: hover {width: 28px ;}. star_rating. three_stars {left: 28px ;}. star_rating. three_stars: hover {width: 42px ;}. sta R_rating. four_stars {left: 42px ;}. star_rating. four_stars: hover {width: 56px ;}. star_rating. five_stars {left: 56px ;}. star_rating. five_stars: hover {width: 70px ;}. star_rating li. current_rating {background: url (http://demo.jb51.net/demoimg/rating_stars.gif) 0 24px; position: absolute; height: 12px; display: block; text-indent:-9000px; z-index: 1; left: 0 ;}# www_zzjs_net {margin: 0 0 20px 20px ;}# www_zzjs_net p {margin: 2 0px 0 5px 0;} --> </style> </pead> <body> provides a high quality webpage effect and advertisement code for webmasters. </Body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]


Js of star rating, but the stars do not shine, and no problem can be found, I hope you can give some advice

Orangutan lighting ~
 
How to Use js to obtain the parameter value of the current url

I don't quite understand the purpose of getting parameters with JS. Maybe it can be used in Ajax.
<Script language = javascript>
Function request (paras ){
Var url = location. href;
Var paraString = url. substring (url. indexOf ("? ") + 1, url. length). split ("&");
Var paraObj = {}
For (I = 0; j = paraString [I]; I ++ ){
ParaObj [j. substring (0, j. indexOf ("= ")). toLowerCase ()] = j. substring (j. indexOf ("=") + 1, j. length );
}
Var returnValue = paraObj [paras. toLowerCase ()];
If (typeof (returnValue) = "undefined "){
Return "";
} Else {
Return returnValue;
}
}
// The address you provided can be as follows:
Var classid = request ("classid ");
Var id = request ("id ");

// Then you can process these parameters.
</Script>

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.