css-transforms

Combination of animation and transition not working properly

回眸只為那壹抹淺笑 提交于 2019-11-27 05:20:40
I have been trying to put some basic CSS3 animation. The objective is to toggle a class on the click event of a button and animate a div based on the added class. The code works perfectly for the first iteration of toggle in Firefox but for other browsers like Chrome and for the next iteration in Firefox the transformation is toggled in a blink of an eye. Please help me to figure out what's going wrong. Snippet: $('button').click(function() { $('div').toggleClass('clicked'); }); div { background-color: #ccc; height: 100px; width: 100px; transition-property: top, left; transition-duration: 1s;

CSS3: transform property not working as expected in chrome

天大地大妈咪最大 提交于 2019-11-27 04:52:17
问题 I am trying to achieve the below thing ..And its working pretty well in firefox but the same css working in chrome is somewhat like this shown below I think -webkit-transform-origin: 50% 100%; doesnt work in chrome or its working but not as expected Demo Jsfiddle #flyDiv { width:720px; height:420px; transform-origin: 50% 100%; perspective: 300; transform: perspective(300px) rotateX(15deg); -webkit-transform: perspective(300px) rotateX(15deg); } 回答1: Probably I have found an error ..This is

Anti-aliasing on rotated div with border image in firefox

心不动则不痛 提交于 2019-11-27 04:43:09
问题 I have a div rotated 45 degrees, with a border image on it. In chrome and safari, it renders fine. In firefox, nasty anti aliasing lines appear around the edge of the rotated div, between the edge of it and its border image. Here's the simple HTML: <div class="container"> <div class="corner"> </div> </div> and here's the CSS: .container { margin: auto; width: 400px; height: 400px; background-color: black; outline: 1px solid #333333; position: relative; overflow: hidden; } .corner { position:

overflow:hidden ignored with border-radius and CSS transforms (webkit only)

不羁岁月 提交于 2019-11-27 04:18:25
问题 I want to have a square image inside a circle. When the user hovers over the image, the image should scale (zoom in). The circle should remain the same size. Only during the CSS transition, the square image overlaps the circle (as if overflow:hidden weren't there at all). Here's a demo with the weird behavior in Chrome and Safari: http://codepen.io/jshawl/full/flbau Working ok in firefox. 回答1: I removed some superfluous markup (the circle and square containers... only needs one) and styled

Why is backface-visibility hidden not working in IE10 when perspective is applied to parent elements?

寵の児 提交于 2019-11-27 03:42:42
Ok, so here's another IE10 glitch. The problem is that applying perspective on parent elements breaks the backface-visibility hidden setting. Please see this fiddle: http://jsfiddle.net/2y4eA When you hover over the red square it rotates by 180° on the x-axis, and even though the backface-visibility is set to hidden, the backface is shown, at least until the 180° is reached, then it disappears. Remove the perspective property, and you'll see that it works as expected, the backface isn't visible at all, but ofcourse the 3d effect is lost. It's possible to workaround this problem by applying

div slanted in 2 directions

北城以北 提交于 2019-11-27 02:57:10
问题 Is it possible to create the following shape as a DIV in CSS . The browser support is not important. 回答1: You cannot skew an element like this directly, you'll need to use two elements (or generated content) and hide certain overflow to make the flat bottom edge: http://jsfiddle.net/6DQUY/1/ #skew { height: 240px; overflow: hidden; } .skew { background: #000; display: inline-block; height: 300px; width: 500px; margin-top: 100px; transform: skew(-8deg, -8deg); } Note: I removed the cross

Controlling CSS cube rotation(transform) and extracting values from 3d matrix

社会主义新天地 提交于 2019-11-27 02:48:27
问题 I made CSS cube that I'm rotating using up/down and left/right keys but I'm having problems regarding rotation direction. Attempt #1 DEMO Using this article I managed to bind keys and apply rotation to the cube. My first problem was that CSS transform function rotates elements axes so when, ie. I press up, Y and Z axis change place. I adjusted original code for that case, but another problem is, since axes are vectors, when I press up 2 times X and Z are back in place but vectors are inverted

How can I apply multiple transform declarations to one element?

只谈情不闲聊 提交于 2019-11-27 02:30:32
问题 I have an element with two classes, one called "rotate" that will rotate the element 360 degrees and another called "doublesize" that will scale the element 2x its normal size: .rotate { transform: rotate(0deg); } .rotate:hover { transform: rotate(360deg); } .doublesize { transform: scale(1); } .doublesize:hover { transform: scale(2); } http://jsfiddle.net/Sbw8W/ I'm guessing this does not work because the classes override each other's transform property? I know that I could easily do this in

What is the right combination of prefixes for CSS transitions and transforms?

荒凉一梦 提交于 2019-11-27 01:54:02
问题 What would be the right way to prefix this CSS in order to cover the widest range of browsers and versions? Version 1: -webkit-transition: -webkit-transform .3s ease-in-out; -moz-transition: -moz-transform .3s ease-in-out; -ms-transition: -ms-transform .3s ease-in-out; -o-transition: -o-transform .3s ease-in-out; transition: transform .3s ease-in-out; -webkit-transform: rotateX(-30deg); -moz-transform: rotateX(-30deg); -ms-transform: rotateX(-30deg); -o-transform: rotateX(-30deg); transform:

CSS3 Transform affecting other elements with chrome/safari

痴心易碎 提交于 2019-11-27 01:52:40
I have an issue where my css3 transformations are effecting other elements on the page and even causing them to sort of flicker. I saw another post about this but they didn't have a resolution with the issue. http://scosha.mybigcommerce.com/w107b/ when you scroll over the navigation you see an animated css3 transformation. It works fine in firefox without flickering but with chrome and safari the effect is very obvious, you see it in the drop down menu items as well as the footer text. This is a known issue with Macintosh text rendering on Chrome 22 (and apparently Safari). GPU acceleration