Playing a CSS animation on hover
How do I make an playing a css animation on hover?
A little example showing how animation-play-state can come in handy. The video tutorial version is on vimeo: http://vimeo.com/61477511. What is a playing a css animation on hover? How do you make a playing a css animation on hover? This script and codes were developed by Val Head on 03 August 2022, Wednesday.
Playing a CSS animation on hover - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Playing a CSS animation on hover</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body {padding:4em; background:#fcfcfc;}
.wrap {width:200px; margin:auto; z-index:1;}
.msg { color: whitesmoke; text-align:center; font-family: 'Bree Serif', Courier, monospaced; font-size:3.5em; width:200px; position:absolute; margin:55px 0 0 2px; pointer-events: none;
}
.sticker { width:200px; height:200px; position:absolute; background: url(https://dl.dropbox.com/u/1143870/i/sticker.png) top center no-repeat; animation: spin 10s linear infinite; /*Set our animation play state to paused initially */ animation-play-state: paused;
}
.sticker:hover { /* Toggle our animation play state to running when we are hovering over our sticker */ animation-play-state: running;
}
@keyframes spin { 100% {transform: rotate(1turn); }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <link href='http://fonts.googleapis.com/css?family=Bree+Serif' rel='stylesheet' type='text/css'>
<div class="wrap"> <div class="sticker"></div> <div class="msg">new!</div>
</div>
</body>
</html>
Playing a CSS animation on hover - Script Codes CSS Codes
body {padding:4em; background:#fcfcfc;}
.wrap {width:200px; margin:auto; z-index:1;}
.msg { color: whitesmoke; text-align:center; font-family: 'Bree Serif', Courier, monospaced; font-size:3.5em; width:200px; position:absolute; margin:55px 0 0 2px; pointer-events: none;
}
.sticker { width:200px; height:200px; position:absolute; background: url(https://dl.dropbox.com/u/1143870/i/sticker.png) top center no-repeat; animation: spin 10s linear infinite; /*Set our animation play state to paused initially */ animation-play-state: paused;
}
.sticker:hover { /* Toggle our animation play state to running when we are hovering over our sticker */ animation-play-state: running;
}
@keyframes spin { 100% {transform: rotate(1turn); }
}
Developer | Val Head |
Username | valhead |
Uploaded | August 03, 2022 |
Rating | 4.5 |
Size | 2,424 Kb |
Views | 40,480 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Nav animation exercise - START | 3,402 Kb |
Net magazine demo - Complete | 5,291 Kb |
Spring physics with CSS variables | 3,591 Kb |
Adding Items | 4,008 Kb |
IOS Gmail loader-ish | 2,920 Kb |
Listening for CSS animation events | 2,665 Kb |
You are getting very sleepy... | 3,242 Kb |
Modal Relationship Examples | 4,612 Kb |
Neon glow letters | 2,595 Kb |
Steps Sprite Animation | 1,942 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
CSS Bot Confusion | Jpod | 3,456 Kb |
Css3 loader | Clknap | 2,391 Kb |
Funny menu | AxeLVaisper | 4,671 Kb |
Drifting Clouds | Benedikte | 2,247 Kb |
Bootstrap Responsive Menu Drawer | JesseGlacken | 3,777 Kb |
Minimal Menu | Achudars | 3,430 Kb |
A form arranged using automatic placement. | Vikasford | 2,103 Kb |
Ionic Infinite outside ion-content with ion-pane | Felquis | 3,117 Kb |
Alter bg opacity on hover... | Chrisboon27 | 2,054 Kb |
Kut D3 | Jellevrswk | 3,687 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!