alexfoxy / lax.js

Simple & lightweight (<4kb gzipped) vanilla JavaScript library to create smooth & beautiful animations when you scroll.
MIT License
10.41k stars 491 forks source link

Presets seem to behave in inverted way #141

Closed ls15web closed 3 years ago

ls15web commented 3 years ago

When I try to get presets, such as scaleIn working, they seem to behave in an inverted way: Instead of scaling from 0% to 100%, the element scales from 100% to 0%, while it enters the viewport.

See following fiddle with the current CDN version (https://cdn.jsdelivr.net/npm/lax.js): https://jsfiddle.net/bhosfL8k/

Am I doing it wrong, or is this a bug?

rickvian commented 3 years ago

I just tested with the preset explorer and somehow under 100 distance it behaves inverted until certain distance (yes i think its bug)

Image 396

meanwhile, have you try to use lax.addElements instead?

alexfoxy commented 3 years ago

When I try to get presets, such as scaleIn working, they seem to behave in an inverted way: Instead of scaling from 0% to 100%, the element scales from 100% to 0%, while it enters the viewport.

See following fiddle with the current CDN version (https://cdn.jsdelivr.net/npm/lax.js): https://jsfiddle.net/bhosfL8k/

Am I doing it wrong, or is this a bug?

I think you need to set the value to greater than 0. Try this <div class="box box-blue lax lax_preset_scaleIn:200:0"> instead

bfintal commented 3 years ago

I think this needs to be reopened. It's still inverted: https://jsfiddle.net/25krwufd/2/