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/