notes slowly only to find that has been written a lot of today, brush the page to think of is not should be sent to their blog inside to share with you although not what Daniel, but still have some small experience ~ Hope and you share, laughed at! we have a Li now need a click to change and another can still be hoverthe product will change color after clicking, then the merchant can still carry on hover. The Undesirable method is:(1) JQ Add click event to change its CSS () This method is not available because modifying Background-color through JavaScript overrides all Background-color attributes defined in the CSS . Of course, it also contains the background-color attribute under hover , so the hover event will fail after a single click event. (2) If JQ uses the AddClass () method, the priority problem is involved. (3) in JS with the JQ hover (), this is still not possible. the preferred method is:(1) can pre-write two CSS style sheets, and a hover stylethen JS write, this time we use JQ inside the attr () directly let two Li's class name change, these two will not involve a series of other problems.
Conflicts between hover and click events