css-animations

Move multiple backgrounds infinitely using CSS

你说的曾经没有我的故事 提交于 2019-11-30 20:09:59
问题 I have two backgrounds: body { background-image: url(img/nemo.png),url(img/ocean.png); } How do I make nemo.png background move infinitely from left-right but not affecting ocean.png background ? EDIT: When he reaches the right most edge (and the image is no longer visible), he will appear from the left edge again and start doing the drifting from left-to-right. 回答1: This can be done with pure CSS 3, e.g keyframed animations: Demo: http://jsfiddle.net/dghsV/112 body { background-image: url(

Move HTML element upwards on hover

谁说我不能喝 提交于 2019-11-30 19:36:57
I am trying to move an HTML up about 10px whenever a user hovers their mouse over it. I did some research on w3schools but I could not find any information that helped me. Most of their animation examples were using keyframes and I'm pretty sure that's not what I need because I'm trying to trigger an animation when somebody hovers over the element. I could be wrong though and that's why I'm posting here. Here's the element I'm trying to move: <div id="arrow"> <a href="#"><i class="fa fa-arrow-down fa-2x"></i></a> </div> For my CSS: #arrow { padding-top: 310px; color: #5C6B7E; position:

Refire CSS animation with javascript after a previous one is complete

前提是你 提交于 2019-11-30 16:38:35
I was trying to use the new animate() function to refire a CSS animation. I'm using Chrome 48 but I wonder if this is even possible right now. The animation should be just a growing and shrinking square. I've tried several things, as you can see, but none worked: var elem = document.querySelector(".box"); document.addEventListener("click", function() { elem.classList.add("close"); elem.animate(); //not working elem.animate("grow"); //not working elem.animate([{ transform: 'scale(1)' }, { transform: 'scale(0)' }], 1500); //not working }); .box { width: 200px; height: 200px; background: #099;

How do I animate an element to swing in CSS3?

拈花ヽ惹草 提交于 2019-11-30 15:23:30
Since I saw the Treahouse website and the sign effect swinging in the tree, I have been trying to reproduce it. .box{ width:50px; height:50px; background: blue; box-shadow: 0 0 5px blue; margin:100px; float: left; -moz-animation: 3s ease 0s normal none infinite swing; -moz-transform-origin: center top; } But it won’t swing. Here’s a demo on JS Fiddle . I also tried a modification of that. bod{ background:blue; } .box{ width:50px; height:50px; background: yellow; box-shadow: 0 0 10px red,0 0 25px red inset; margin:100px; float: left; -moz-animation: 3s ease 0s normal none infinite swing; -moz

How to create a pulsing glow ring animation in CSS?

对着背影说爱祢 提交于 2019-11-30 15:07:43
问题 I like the way this website made their rings glow and pulse out and would like to know how they did it. I can make something similar but I'm not very good. So this is all I was able to figure out but it doesn't seem to work. CSS: glowycircleouter.blue .glow4 { box-shadow: 0 0 25px #287ec6; } .glowycircleouter .glow4 { -webkit-animation: glowyglow 3s 2250ms infinite; -moz-animation: glowyglow 3s 2250ms infinite; -ms-animation: glowyglow 3s 2250ms infinite; -o-animation: glowyglow 3s 2250ms

Flip div with two sides of html

*爱你&永不变心* 提交于 2019-11-30 14:20:33
问题 I have a login form on a site I am currently building, and I also have a signup form. I would like to add some fancy animation to it by rotating the div to the other side when the "Sign up" link is clicked. I want the login form to be on the front side, and the signup form on the back. I would rather not use javascript, but if necessary, I will. Thanks for any possible answers! 回答1: You can do the animation using CSS transition and transform: rotateY() with no Javascript, other than

How to create a pulsing glow ring animation in CSS?

喜欢而已 提交于 2019-11-30 13:45:10
I like the way this website made their rings glow and pulse out and would like to know how they did it. I can make something similar but I'm not very good. So this is all I was able to figure out but it doesn't seem to work. CSS: glowycircleouter.blue .glow4 { box-shadow: 0 0 25px #287ec6; } .glowycircleouter .glow4 { -webkit-animation: glowyglow 3s 2250ms infinite; -moz-animation: glowyglow 3s 2250ms infinite; -ms-animation: glowyglow 3s 2250ms infinite; -o-animation: glowyglow 3s 2250ms infinite; animation: glowyglow 3s 2250ms infinite; animation-name: glowyglow; animation-duration: 3s;

Rotating a background image with CSS3

一世执手 提交于 2019-11-30 12:14:52
I have a background image that has an arrow that points to the right. When a user clicks on the button, the selected state changes the arrow to point down (using a different background position in my image sprite). Is there anyway to animate this using CSS3 so once the button is clicked and jQuery assigns it a "selected" class, it will rotate in an animation (only 90 degrees) from the right to down? (preferably using the single image/position with the arrow that points to the right) I'm unsure as to whether transform or key animation frames need to be used. you could use the ::after (or :

CSS3 Transition: Different transition for *IN* and *OUT* (or returning from transitioned state)

霸气de小男生 提交于 2019-11-30 11:46:31
Original Question... updated working code below: I have a loading image which comes up during an ajax load event. The image shows/hides by adding or removing a "loading" class to the body element. Currently, the loading image animates background-size from 0 to 100%, and fades in the opacity (vice versa for the 'return' transition). What I want to accomplish, though, is to have the background-size transition happen instantly (not transition) on the fade out, so: Fade in: opacity from 0 to 1 in .2s, background size from 0 to 100% in .2s Fade out: opacity from 1 to 0 in .2s, background size from

CSS Animation: Number increment effect

梦想与她 提交于 2019-11-30 11:37:45
问题 I'm wanting to get that animation effect when numbers change quickly, example: http://jsbin.com/kevalutupe/1/ I'm wanting to do this CSS alone (I know how to code it in JS), I don't want to use JS as I feel hammering the DOM isn't the best solution. Is this at all possible with CSS? I'm not fussed about the numbers actually incrementing correctly, I'm just after the effect. 回答1: The number spinning effect is most definitely possible using CSS3 animations and what's better you can also set the