The advantage of using js to implement is: if there are many hover effects of images in a website, each one may need to be controlled by css, so the code will be redundant. But with js control, no matter how many pictures there are, the hover effect can use the same js, but it must be ensured that the out/off effects and over/on effects of the pictures are named regularly, such as:
navi01_out.jpg/navi01_off. jpg
navi01_over.jpg/nvai02_on.jpg
This way js control is very convenient. A matching name is found and replaced with another name on hover.
Today I want to use jQuery to control the effect:
The code is as follows: