jquery Star Scoring Effects

Source: Internet
Author: User

Write at the beginning:

I used to say that I learned jquery well, but I've never done anything, and I've been looking for all kinds of reasons. Recently really want to learn jquery, because my family that has always been the encouragement, I decided to work hard, good cheer. At present the level is limited (rookie), also invites everybody to contain more.

Case:

Final effect:

1. First is the HTML part, the whole is a large div, mainly contains span, UL, p Tags:

2.CSS Style structure

3.jquery Code

Through this case, write your own study notes, at the beginning of the time do not know how to judge the current selection is the number of stars, through the baby to explain the example (Xiao Liu home has 3 sons, there is an aunt met Xiao Liu asked: "Xiao Liu you at home the first few ah?" If Xiao Liu is the second, then he must answer is the second, he can clearly understand the $ (this). Index (), which is the value of the current Li, and the index value is counted starting at 0, so the value named Currentindex is $ (this). Index () + 1, when the mouse moved to a star, the star and the front of the star will be lit up. Here the each () method is to traverse all Li in ul, if $ (this) is <currentindex when the index () is lit.

It's hard for me to write this case: 1. The traversal of the index using 2.each () does not know 3. Do not know how to judge the current selection is the number of stars, and how to let the current selection and the previous star lit up.

PS: Thank you for my family has been to give their patience to explain, thank you baby.

jquery Star Scoring Effects

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.