Jump to content
Search Community

Having an issue with borderWidth

haxen2000 test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Might 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!

Link to comment
Share on other sites

Hello... and welcome to the GreenSock Forums!

If you check Mozilla Developer Network.. you will see how border-width is not an animated property

https://developer.mozilla.org/en-US/docs/Web/CSS/border-width

You have to use the non shorthand properties..

Animatable as each of the properties of the shorthand:
border-bottom-width: yes
border-left-width: yes
border-right-width: yes
border-top-width: yes

 

border-width: no

And if you dont use quotes.. make sure you use camelCase for the property name.. ie. borderTopWidth for example

Hope this helps..

  • Like 2
Link to comment
Share on other sites

If you just use a single value (like "10px"), it should be fine. I think the problem is that you're using a complex value (like "10px 12px 9px 10px"). Of course you could still animate that if you want, using a generic proxy object and an onUpdate where you apply it, but it's not as convenient. 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...