css-transitions

Animating non-animatable properties with CSS3 transitions

断了今生、忘了曾经 提交于 2019-12-01 07:38:40
In my app I'm animating the opacity of elements on the page with something like: .s { transition-property: opacity; transition-duration: 250ms; } (with vendor-specific versions, of course). And then .s.hidden { opacity: 0; } So the animation starts when the hidden class is assigned. Problem is, mouse events are still detected on elements with opacity zero, which I don't want, so I need to either set visibility to hidden or display to none after the transition is finished. I would hope to be able to do something like: .s { transition-property: opacity, visibility; transition-duration: 250ms;

Smooth Infinite Scrolling Banner [CSS Only]

ⅰ亾dé卋堺 提交于 2019-12-01 06:54:13
Looking to optimize this infinite scrolling effect, however I'm not entirely sure how to create a smooth transition when looping back to the original image. At 10s it's hardly noticeable, however at 30s it's more evident. I'm assuming it has something to do with the ending position margin, but can't quite pinpoint it. What should the value of the last frame be? JSFiddle HTML: <div class="container"> <div class="photobanner"> <img class="first" src="http://placehold.it/350x150"> <img src="http://placehold.it/350x150"> <img src="http://placehold.it/350x150"> <img src="http://placehold.it/350x150

Change background from bottom to top on hover

百般思念 提交于 2019-12-01 05:32:29
问题 How I can change the background-color on a:hover using a transition from the bottom to the top with a duration of 0.3s? <ul> <li><a></a></li> <li><a></a></li> <li><a></a></li> </ul> Is that possible? Thanks 回答1: There is no way to (generically) apply a transition direction in CSS . However, we can work around that limitation by using a pseudo element (or other method like how this example uses gradients). By using a pseudo element, which initially has a visible height of 0, we can transition

Wait for css transition [duplicate]

浪子不回头ぞ 提交于 2019-12-01 05:02:59
问题 This question already has answers here : Callback when CSS3 transition finishes (5 answers) Closed 6 years ago . I am using css transitions to set the margin of one of my div. I need to know how can I wait for this effect to end so I can call other function then... Is there any way? I read some other posts on stack overflow but they all look different from my problem. 回答1: Try This SO answer The transition listner events vary in each browser, so the below function will find which listener to

Smooth Infinite Scrolling Banner [CSS Only]

雨燕双飞 提交于 2019-12-01 04:53:26
问题 Looking to optimize this infinite scrolling effect, however I'm not entirely sure how to create a smooth transition when looping back to the original image. At 10s it's hardly noticeable, however at 30s it's more evident. I'm assuming it has something to do with the ending position margin, but can't quite pinpoint it. What should the value of the last frame be? JSFiddle HTML: <div class="container"> <div class="photobanner"> <img class="first" src="http://placehold.it/350x150"> <img src="http

How do I detect a transition end without a JavaScript library?

≡放荡痞女 提交于 2019-12-01 03:38:35
I'd like to delete an object after it's done animating with a CSS transition, but I'm not able to use a JavaScript library. How do I detect when the animation is done? Do I use a callback or custom event somehow? element.addEventListener('transitionend', function(event) { alert("CSS Property completed: " + event.propertyName); }, false ); For now, the exact event name has not been standardized. Here's a quote from MDN : There is a single event that is fired when transitions complete. In all standard-compliant browser, the event is transitionend , in WebKit it is webkitTransitionEnd . Here's

How can I create a looping fade-in/out image effect using CSS 3 transitions?

孤街浪徒 提交于 2019-12-01 03:22:09
问题 I’m trying to create a looping fade in/out effect for an image. It’s working in Chrome, but it doesn’t work in Firefox. Here’s the code: http://jsfiddle.net/FTLJA/254/ (I did make it work with jQuery but that made the browser slow and flickery on Android phones, so I’m trying CSS instead.) Thanks for any help. Update: fixed.. please check the link again 回答1: Well, if ypu're only setting the WebKit properties (only @-webkit-keyframes and only -webkit-animation-... ), then of course it will

CSS3 transition for “top” and “left” properties not working

夙愿已清 提交于 2019-12-01 02:33:41
I have a list with one item on the list transitioning to the northeast when I hover over it. Using margin-top and margin-left property transitions worked but the item being hovered over kept pushing other elements so I added position:relative and tried using top and left transition properties but it didn't seem to be working. Here is the jsfiddle: list hover Have you tried setting the parent of your list. I know sometimes relative has issue unless the underlying item is also relative or absolute. Just a thought. Add left, top default link demo left: 0px Use position:absolute and it will take

CSS Webkit Transition - Fade out slowly than Fade in

前提是你 提交于 2019-12-01 02:31:18
This is what I have: .box{ background:#FFF; -webkit-transition: background 0.5s; } .box:hover{ background:#000; } But this appends to both onmouseover and onmouseout actions, but isn't there a way to control them? Something like: -wekbkit-transition-IN: background 1s; -webkit-transition-OUT: background 10s; Just redifine your transition in the over pseudo element. .box{ background: white; -webkit-transition: background 5s; } .box:hover{ background: olive; -webkit-transition: background 1s; } Look my http://jsfiddle.net/DoubleYo/nY8U8/ Either use an animation (only in webkit currently), or use

Animating margins and padding with CSS Transition causes jumpy animation

痞子三分冷 提交于 2019-12-01 00:15:36
问题 At my personal website, I'm using the CSS3 Transition property on the top nav to animate the margins and padding of an element with a border, to make the border swell on hover. Relevant markup: <nav> <a class="email" href="mailto:notmyrealemailaddress"> <div class="icon-border"> <img src="images/mail_icon.png" width="14" height="12"> </div>Email Me</a> <a class="phone" href="tel:4075555555"> <div class="icon-border"> <img src="images/phone_icon.png" width="11" height="18"> </div>Call Me</a>