css-transitions

Clear CSS Transitions

廉价感情. 提交于 2019-12-06 18:07:40
问题 I use a CSS framework which applies transitions on moving the mouse over input elements. I have a class which I want to not have this transition. Is this possible? 回答1: Just put transition:none; in the css and make its priority higher than the others. Example: html: <div class="a"></div> <div class="a b"></div> ​ css: div.a { width: 200px; height: 100px; border: 1px solid black; background-color: #EEE; -webkit-transition: background-color 0.5s; } div.a:hover { background-color: #069; } div.a

How do I animate a clicked link before leaving page?

♀尐吖头ヾ 提交于 2019-12-06 15:46:23
Here's what I want to achieve: When an HTML link is clicked, I want to animate it before leaving the page If the link is opened in a new window/tab, the animation should not take place How on earth do I achieve this? You could use javascript $(function(){ $(".btn").bind("click",function(){ $(this).animate({'left': '100px'}, 100, function(){ window.location.href = index.html }) }) }) But you'll have to stop the default action if your button is a link. You'll need to capture the click event, prevent the default action, do the animation, then load the new page. If using jquery (Available as a

Is it possible to combine translateX/translateY and scale in single CSS transition?

柔情痞子 提交于 2019-12-06 15:30:50
I have been playing around with looping of CSS transitions (following this article ). The transition itself could be divided into 4 (looped) phases: shrinked2=>expanded=>expanded2=>shrinked These states are represented by 4 classes: shrinked2 - stateOne expanded - stateTwo expanded2 - stateThree shrinked2 - stateFour I am, initially, setting the width and height of my element, being transitioned, in percents via id. Then, to trigger transition, I am changing transform: scale via state classes, listed above. Up to his point it basically works fine for me, here is demonstration on JSFiddle . Now

How is it possible to transition the position of items in a list without using transform or top/left

眉间皱痕 提交于 2019-12-06 12:20:41
问题 The other day I stumbled onto an example that uses Vue.js, but my question is more about the CSS and HTML that Vue uses to achieve the transition between states. The cards temporarily get the class .shuffleMedium-move which adds a transition: transform 1s and the order of the nodes change in the DOM, but I don't understand why the transition occurs since the transform property never seems to get set and the items are positioned simply using float:left . I've been doing CSS for quite a while

Transition centered text to left / right edges without overflowing

試著忘記壹切 提交于 2019-12-06 09:49:52
I was able to transition text-align from center to left . With this code, if you run it, then hover over, you'll see the top one goes to the left. However the bottom overflows on the right ; how can I figure out how to make the transition to right not overflow? Note: This is a demo of my real application, which has strings/elements of unknown/variable width, from 1 to anything to fill a single line (no wrapping). .header { position: fixed; width: 70%; background-color: springgreen; } .title { text-align: center; } .menu { text-align: center; } .trans-left { transition: margin-right 1s; }

Transition pixel to percent

假如想象 提交于 2019-12-06 08:42:36
问题 I would like do a transition using CSS, but my element's dimensions are in pixels normally but in percent during the :hover event, and the transition doesn't work like this. Do you know any way to do this? 回答1: You may have to use JavaScript to change the percentage value to pixels after it has been calculated. I think webkit reports dimensions in px regardless of how they were set when called via JavaScript. 回答2: You can apply the transition on the % width and just use min-width as px fixed

Card Flip effect using CSS3 rotateY but with multiple faces depending on button press?

让人想犯罪 __ 提交于 2019-12-06 06:45:26
问题 So I need to create a flipping image almost exactly like this. But the difference is what if I want several buttons and each one flips to a specific face. Lets say I want 4 buttons labelled 1, 2, 3 and 4, and I want 4 different card faces, each a different color with the corresponding number on the face. So the page will load with face 1 showing and clicking on button 1 will do nothing, but clicking on button 3 will flip to a face showing the number 3 and so on etc etc. Any ideas? 回答1: Simple

How to play reverse keyframe animation for hover off?

梦想的初衷 提交于 2019-12-06 05:01:27
I'm trying to build a dropdown menu where first the dropdown slides down, then one-by-one menu items appear from the bottom. On hover, it looks good but I don't know how to play it smoothly on hover off. What I'm trying to do is hide the second sub-menu item first, then the first submenu item, then the dropdown slides up. What I tried is to add the hide animation keyframes with a delay by default to the dropdown, and add the show animation on hover with 0 delay. But its not working properly as you can see.(and it will animate on page load too, which is not good for me) ul li ul { -webkit

Is there a Firefox equivalent to Chrome's “translateZ(0);” to force GPU accelerated CSS animation?

故事扮演 提交于 2019-12-06 03:51:34
问题 I have a CSS3 transition which is smooth as silk in Chrome, but choppy in (the latest version of) Firefox I know that I can force GPU acceleration on a DOM object in Chrome by setting -webkit-transform: translateZ(0); on it Is there an equivalent style I can add to force GPU acceleration in Firefox? 回答1: Firefox GPU-accelerates by default when it can. So there's nothing to "force" GPU acceleration: if it's possible, it's already done. 来源: https://stackoverflow.com/questions/9012753/is-there-a

CSS3 transition scale but not translation

試著忘記壹切 提交于 2019-12-06 03:28:19
I couldn't find an answer to this anywhere, probably because it doesn't exist, but anyway: Rather than defining "transition-property: transform", is it possible to define transitions for translation and scale independently? Right now I got the following definition: .logo { position: absolute; -webkit-transition: -webkit-transform 1s ease-out; } This way, when I set "-webkit-transform" to "scale($s) translate3D($x,$y,$z)" (with $s etc. being arbitrary values) both are animated, but I only want the scale to be... Thanks for any hints in advance! The hacky way to solve this is to use a wrapper