Search the Community
Showing results for tags 'border-width'.
Found 2 results
Hi I would like to tween a <div> with a 25px border so that it shrinks in from the right. I know when animating I should really use the scaleX property, but this shrinks the vertical borders of the div. The obvious work around in terms of keeping the border thickness uniform is to use the width property, but I can't set a transformOrigin on the width property, so I've used a hack and basically increased the right: px; value to counter this. Here is the codepen to illustrate this: http://codepen.io/pauljohnknight/pen/qagBWY Is there a more efficient solution to this i.e. how to reduce a div in size on its x-axis so it reduces in from the righthand side, without affecting the border thickness? My main concern with doing it this way is the janking / flickering in the animation when integrated into the site it will be on. P.S the pen is linked to a scrollMagic scene, so you will need to scroll to see the effect. Thanks in advance for any help / ideas Paul
Having an issue with borderWidthMight be doing something wrong here, but I'm curious if anyone else has had this issue. I am trying to animate the border of an input area from 0 to a width back to 0. Going from a width to 0 works fine, but going from 0 to the width immediately jumps to the width while everything else animates. I've made an exaggerated example here: http://jsfiddle.net/Haxen2000/Df8xj/ The original margin is what the border width should be; just made it larger so the issue is more visible. Thanks!