Home >Web Front-end >JS Tutorial >Alternate color and black and white in each part of the photo_Image special effects

Alternate color and black and white in each part of the photo_Image special effects

WBOY
WBOYOriginal
2016-05-16 19:19:381456browse

[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute ]

Let’s take a look at the code first







Isn’t it very simple, and the pictures we use are only the two pictures below

Alternate color and black and white in each part of the photo_Image special effects

Now let’s analyze the usage of background-position: At the beginning of the A element, the background position is set to background-position:500px 500px, and its size is only 100px*100px, so all the backgrounds under the A tag exceed The visible range cannot be displayed, and the black and white photo we see at the beginning is the background image of UL. Then when the mouse moves to the A element, the moving size of the background is set for each A element according to its position, thus forming the alternating black and white picture effect above.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn