Select and deselect the check box to enable background color change and deselect color change.

Source: Internet
Author: User

Select and deselect the check box to enable background color change and deselect color change.

Select and deselect the check box to enable background color change and cancel color change:
In order to improve the humanization of the News list such as the table, there are currently many measures, the most common is the color of the mouse floating line or the color of the line, this chapter introduces another form, that is, there is a check box, the Select and deselect check boxes can change the background color of the corresponding line or cancel the color change. The Code is as follows:

 

<! DOCTYPE html> 

 

The above Code meets our requirements. When the mouse is suspended, the line color can be changed. When the checkbox is selected or canceled, the background color of the corresponding line can be changed or the color changing effect can be canceled, the code is relatively simple and I will not introduce it here. For more information, see.
Related reading:
1. For details about hover (), refer to the hover event section of jQuery.
2. For the toggleClass () function, see the toggleClass () method section of jQuery.
3. For details about click events, see click events in jQuery.
4. For details about closest (), refer to jQuery's closest () function.
5. For more information about the attr () function, see the attr () method section of jQuery.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 11542.

For more information, see: http://www.softwhy.com/jquery/

 

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.