Search code examples
javascripthtmlskrollr

skrollrjs constant multiplication


Is there a way to use.. math basically.. in templates on constants? Something like, say, this:

<div data-_const-top="x: y"></div>
<div data-_const*2-top="x: y"></div>

or even

<div data-_const-top="x: y"></div>
<div data-_const+_consnt-top*2="x: y"></div>

Or how else do you animate something for the height of the window for example? By setting multiple constacts? like

constants: {
 vh: '100p',
 vhx2: '200p'
}

?


Solution

  • No, there is no such feature. Could be added by modifying this

    https://github.com/Prinzhorn/skrollr/blob/master/src/skrollr.js#L424