Saartje87 / pbjs-0.6

Rewite of pbjs
4 stars 0 forks source link

animation class #5

Open Saartje87 opened 11 years ago

Saartje87 commented 11 years ago

Should handle scrollbar animations.

Should be used to add an morph method for browsers that don't support css transitions

jonkoops commented 11 years ago

Are you referring to element.scrollTop and element.scrollLeft?

Saartje87 commented 11 years ago

Yes :)

For example we could extend PB.$.fn.setScroll with some additional arguments to animate scroll.

PB.$('#element').setScroll({
    top: 400,
    left: 100
}, 0.4 /* duration in seconds */, 'easeInOut' /* animation effect */);
jonkoops commented 11 years ago

Maybe we should make all numeric properties animatable, not just CSS values.

Saartje87 commented 11 years ago

Would indeed be interesting. Guess this means we should ditch css transitions and animate all properties ourself?

jonkoops commented 11 years ago

I think it would be best to whitelist CSS transitions, in order to keep H/W acceleration performance up. But fall back to numeric transitions when there is no CSS animation available. The spec has a list of all transition able properties: http://www.w3.org/TR/css3-transitions/#properties-from-css-