css-transitions

CSS Transitions with :before and :after pseudo elements

纵饮孤独 提交于 2019-11-27 17:10:16
问题 Can't seem to animate pseudo elements with -webkit-transition. The fiddle below shows what I mean when run in Chrome/Safari, I guess this isn't supported right now? http://jsfiddle.net/4rnsx/130/ 回答1: Fixed in Google Chrome on January 3rd, 2013. By now (I do update this list) it's supported in: FireFox 4.0 and above Chrome 26 and above IE 10 and above Waiting for Safari and Chrome for Android to pull these updates. You can test it yourself in your browser, or See the browser support table.

CSS: Animation vs. Transition

你离开我真会死。 提交于 2019-11-27 16:45:36
So, I understand how to perform both CSS3 transitions and animations. What is not clear, and I've googled, is when to use which. For example, if I want to make a ball bounce, it is clear that animation is the way to go. I could provide keyframes and the browser would do the intermediates frames and I'll have a nice animation going. However, there are cases when a said effect can be achieved either way. A simple and common example would be implement the facebook style sliding drawer menu: This effect can be achieved through transitions like so: .sf-page { -webkit-transition: -webkit-transform

Why transitions for some CSS properties are slow and none fluent

▼魔方 西西 提交于 2019-11-27 16:12:01
问题 I spent a bout 4 hours on having a simple transition with an acceptable performance: First I tried this code : left: 2000px; -webkit-transition: left 1s linear; -moz-transition: left 1s linear; -ms-transition: left 1s linear; The result was terrible on Chrome v21.0.1180.89 and FireFox v15.0.1, but was great on IE10. I captured the CPU usage and GPU usage graph and found that chrome does not use GPU for basic css properties, What is the solution for modern-browsers? 回答1: Don't use left or top,

how to make CSS animation to play every 10 seconds

不羁的心 提交于 2019-11-27 15:15:54
问题 I have a css animation, which it either repeat infinite or only a certain times. but I would like to play it like 2 times every 5 seconds. Here is my code: #countText{ -webkit-animation-name: color2; -webkit-animation-duration: 1s; -webkit-animation-iteration-count: 2; -webkit-animation-timing-function: linear; -webkit-animation-delay: 5s; } @-webkit-keyframes color2 { 0% { } 25% { text-shadow:-2px -5px 10px #fb0017, -5px 0px 10px #3a00cd, -5px 5px 10px #00ff3a} 50% { } 75% { text-shadow:2px

Get/set current @keyframes percentage/change keyframes

风流意气都作罢 提交于 2019-11-27 14:26:22
Is it possible to get/set the current animation percentage of a CSS3 @keyframes animation using javascript, jQuery, or some other means? Say for example there is a div with class called .spin that simply spins around in a circle using a keyframe also called spin . I have tried to get the current percentage value of the animation using $('.spin').css('animation') , $('.spin').css('animation: spin') , and a couple other ways, but they all alert empty I'm also interested in changing the original animation at each predefined keyframe % and I have tried things like $('.spin').css('animation', '.

How To Add CSS3 Transition With HTML5 details/summary tag reveal?

痴心易碎 提交于 2019-11-27 13:12:36
问题 Using just CSS3, is there a way to add a nice fade-in and slide-from-left transition effect on a DETAILS / SUMMARY reveal? For a demo of this new tag, see this demo: https://jsfiddle.net/43m61yt0/1/ Here's the HTML for it: <details> <summary>Copyright 1999-2014.</summary> <section> <p> - by Refsnes Data. All Rights Reserved.</p> <p>All content and graphics on this web site are the property of the company Refsnes Data.</p> </section> </details> In my case, after the summary tag, I put all

Clean way to programmatically use CSS transitions from JS?

五迷三道 提交于 2019-11-27 13:12:22
As the title implies, is there a proper way to set some initial CSS properties (or class) and tell the browser to transition these to another value? For example ( fiddle ): var el = document.querySelector('div'), st = el.style; st.opacity = 0; st.transition = 'opacity 2s'; st.opacity = 1; This will not animate the opacity of the element in Chrome 29/Firefox 23. This is because ( source ): [...] you’ll find that if you apply both sets of properties, one immediately after the other, then the browser tries to optimize the property changes, ignoring your initial properties and preventing a

PolyFill/Shim for CSS transitions and animations

我与影子孤独终老i 提交于 2019-11-27 12:50:42
问题 Google is failing me somewhat on this (I think because the terminology for PolyFill/Shim/Spackle is new and diverse at the moment). I'm trying to find a good JavaScript PolyFill or Shim for webkit's (and now as of the RC FireFox 4's) CSS transitions. I have found this work that Weston Ruter did, but it hasn't been updated in a while, and uses browser detection as opposed to feature detection. I also uncovered FakeSmile but it is geared mostly to SVG animation. Does anyone know of any good

Turning off Twitter Bootstrap Navbar Transition animation

北城余情 提交于 2019-11-27 11:54:54
Just like http://twitter.github.com/bootstrap , The site what I working on now is responsive. I would like to remove transition animation when I click the collapsed navbar menu button. Above picture is the screenshot of what I'm asking. At TOP-RIGHT-CORNER , there is a three-lined menu button. Bootstrap accomplishes the transition animation of the responsive nav bar the same way it does any collapse, which is using a CSS3 transition. To turn off the transition for only the navbar (leaving any other transitions in place), you simply have to override the CSS. I'd suggest adding a class, such as

Animate an element's width from 0 to 100%, with it and it's wrapper being only as wide as they need to be, without a pre-set width, in CSS3 or jQuery

蓝咒 提交于 2019-11-27 11:39:05
http://jsfiddle.net/nicktheandroid/tVHYg/ When hovering .wrapper , it's child element .contents should animate from 0px to it's natural width. Then when the mouse is removed from .wrapper , it should animate back down to 0px . The .wrapper element should only be as wide as it needs to be (allowing .contents to grow), so .wrapper should grow in width and shrink in width as .contents does. There should be no set width for .contents . I'm using CSS3, but it could be accomplished in jQuery, that would be fine. The problem: See the JSfiddle .wrapper is not only as wide as it needs to be. when