New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSS3 support, replaces the normal Fx.Morph, Fx.Tween and Fx.Elements #1021
Conversation
Add CSS3 transition support in place of Fx.Elements Fix missing variable Trying again Problems Problem Working CSS3 functions moved from core Fixes and a test for tween Fixes and tests for the rest
Not a fan of the name Btw. can you post some examples on JsFiddle, please? |
style = document.documentElement.style; | ||
for (var l = prefixes.length; l--;){ | ||
var prefix = prefixes[l]; | ||
if (typeof style[(prefix ? prefix + 'T' : 't') + 'ransition'] != 'undefined') return prefix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be reading this wrong, but doesn't this still test for the unprefixed property? Please don't do that in widely uses libraries.
See this thread for more infos: https://lists.webkit.org/pipermail/webkit-dev/2011-July/017537.html
Also for the same reason the ms prefix should probably be omitted until it can be tested with a beta.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesnt, but looks a bit like it does because i havent properly tidied up some copied code, I have addresses this in new commit
Removed some animatable properties from this list Remove animation css afterwards A bit of refactoring
Unfortunately its not very easy to pause a css animation where it is. Getting the css properties during the animation just returns the final values. It would be possible to get height and width via element.clientHeight/Width but this is obviously limited to these properties only. Therefore I think the best option is to just provide stop/cancel which will remove the animation properties, causing the animation to instantly complete. |
is there any desire to merge this? |
I'd love to see this being pulled in. Especially considering the fact that current Fx class is pretty sluggish on Chrome (presumably a bug introduced a few versions back, and still not being resolved). |
there is an example of it here |
So does it work as a drop-in, and will force CSS3 transforms/transitions to |
yes, if you inspect the element as it animate you will see the styles are changed. |
This is epic. If this is not pulled into the official repo (which unfortunately might happen), I'm going to use your branch as my base |
/ping @arian |
I think this should fall-back automatically to use JS-based animations when CSS3 aren't available. Either I'm missing something or it doesn't work like that. |
@oskarkrawczyk It would have fallen back, as it checks for css3 compatibility for each animation, but i have now added if no animation is available it wont even create the Fx. ... .CSS3 classes. |
I was trying to drop-in your class, and unfortunately I'm getting a Still trying to pinpoint what's the exact issue. |
This provides new implementations of Fx.Morph, Tween and Elements using CSS3. It replaces the normal implementation, but keeps it available and uses it when css3 is unsupported.
Related pull request mootools/mootools-core#2053
Many bugs have been fixed since that version, and advice regarding not falling back to unprefixed properties followed.
I have also added some tests to show it working.