Search code examples
jqueryskrollr

jQuery Skrollr plugin: using skrollr constants as data values


Is it possible to use constants (which are actually not constants) for values, too? For ex:

<div data-_foo="_bar"></div>

and

skrollr.init({
   constants: {
     foo: function () { return 500; },
     bar: function() { return 'top: 200px';}
   }
});

A use case would be for example when the animation values depends on the screen size.


Solution

  • Ok, actually can be easily resolved with changing the values of the data-_foo on resize. 1 step more is not so much...