jquery Star Scoring effect (1/5)

Source: Internet
Author: User
Tags php script jquery library

<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>jquery Star Scoring Effect </title>

<body>
Here is a good evaluation with little impact. This does not include PHP tutorials, it is the only web effects, HTML format, CSS tutorials and images. If you like this, I have my php script created, but will not support it, I quickly throw it together. But, how can that be, now back to this position.

Look below you can see we will be created with this project complete.

Jump to complete source code | | download source. Zip

We first are an HTML file, jquery library, Star_rating.js (contains all the effects), and a folder with some image pictures.

First let's look at the file structure.

Now I include all the CSS in the HTML file, cut out the laziness, so you don't have a small amount of extra files with a CSS in it.

So let's talk about the HTML.

Except that hidden form fields contain the selected final evaluation everything is included in the Rating_cont department.

Inside is mainly three partitions Rating_cont Div's

<div id= "Rating_cont" >
<div id= "Rating_btns" ></div>
<div id= "rating_on" >&nbsp;</div>
<div id= "rated" ></div>
</div>
<input type= "hidden" id= "
rating_output" name= "Rating_output" value= "Not rated"/>

CSS Code

#rating_cont {background: #1e1d1c URL (images/rating_background.jpg) top left no-repeat; border:1px solid #f9ba0d; width:140px; height:23px; Text-align:left; margin-left:6px;}

This gives people a background image of the closure of celebrities ' and creates our height, width, border, and background for our main container.

Next, let's create the CSS for the rating_btns part of the HTML.

The Rating_btns department will be with it's actual ratings in the unordered list.

Look underneath.

<ul>
<li>0.5</li>
<li>1.0</li>
<li>1.5</li>
<li>2.0</li>
<li>2.5</li>
<li>3.0</li>
<li>3.5</li>
<li>4.0</li>
<li>4.5</li>
<li>5.0</li>
</ul>

If you do the code step-by-step, I'm sure you noticed that this looks very ugly now. Let's add the CSS to the Rating_btns section and UL certify us.

The Rating_btns partition needs to be higher than the rating_on partition, we will create the future, so we will be in this relative position and a z-100 exponent. We also add height and width to define our <li> links to the container.

The internal Rating_btns division is our <ul> and its <li>. We do not want our <ul> or our <li> to have any margin or padding. 14px width is required in the <li>. Guess the reason. 14X100 = 140! Yes, you know. This is our container, amazing width, I know. We will float them and give them a block display so they don't go to each other, last but not least, change the font display. We will change the font 1px and be the same color as the background. I'm sure you ask, why not empty, so that they don't have any text in there? Well, we'll use this text to tell us about your jquery script hovering over the

#rating_btns {position:relative; z-index:100; width:140px; height:21px;}
#rating_btns ul, #rating_btns li {padding:0; margin:0;}
#rating_btns li {float:left; width:14px; height:21px; display:block; font-size:1px; cursor:pointer; color: #1e1d1c; }

Home 1 2 3 4 5 last

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.