简体   繁体   English

如何在html5,css3或jQuery中移动鼠标时创建移动粒子?

[英]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. 在此404页中 ,我可以看到星星粒子在随着鼠标在浏览器中不同位置上的移动而移动。 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 . 它们是使用视差效果的固定图像 ,您可以在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/ 最常见,响应最快和最佳优化的解决方案使用JQuery,例如以下一种: 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. 基本上,这种工作方式是通过使用多个图层并根据鼠标的坐标来增加或减少其absoluterelative位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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