简体   繁体   中英

How to create moving particles as mouse moves in html5, css3, or jQuery?

In this 404 page , I can see the stars particle is moving as the mouse moving in different locations in the browser. I have no idea how to call this effect.

Can anyone provide a hint of the name of the effect and what is the right tool and how to achieve this? Thanks!

The stars and every layer on that example are not particles. They are fixed images using Parallax effect as you can see on the elements that compose the page under the div#container_layer .

This effect can be achieved from various ways. The most common, responsive and best optimised solutions use JQuery, such as this one: http://wagerfield.github.io/parallax/

Basically the way this works is by using a number of layers and incrementing or decrementing their absolute or relative position based on the mouse's co-ordinates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM