Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the Animation effect of Mouse suspension and stop by css3

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you css3 how to achieve mouse suspension stop animation effect, I hope you will gain something after reading this article, let's discuss it together!

In css, you can use the ": hover" selector and the "animation-play-state" attribute to achieve the mouse hover animation effect, with the syntax of "animation element: hover {animation-play-state:paused;}".

The operating environment of this tutorial: windows10 system, CSS3&&HTML5 version, Dell G3 computer.

In css, you can use the animation attribute to animate an element; then use the @ keyframes rule to animate your work.

When we play the animation, if we want to pause the animation, we need to use the property animation-play-state. The animation-play-state property has two values: paused: pause the animation; running: continue to play the animation

We can pause the animation by selecting the state when the mouse is hovering over the element through the hover selector.

Let's take a look at it through an example, which is as follows:

Document div {width:100px; height:100px; background-color:pink; animation:fadenum 5s infinite;} @ keyframes fadenum {100% {transform:rotate (360deg);}} div:hover {animation-play-state:paused;}

Output result:

After reading this article, I believe you have a certain understanding of "css3 how to achieve mouse suspension stop animation effect". If you want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report