Callback Function on init
Is there a callback available once it has been initialized?
There is the 'onscroll' option avaiable which can serve your purpose. It's mentioned on the plugin website. Is this what you were looking for?
$.jInvertScroll(['.myScrollableElements'], {
width: 'auto', // Page width (auto or int value)
height: 'auto', // Page height (the shorter, the faster the scroll)
onScroll: function(percent)
{
if(percent > 0.2 && percent <0.5)
{$("body").css("backgroundColor","black")}
else{$("body").css("backgroundColor","blue")}
}
}
});
Hi, at the moment there is no specific callback when it is initialized, but you can, as sakshamsaxena said, use the onscroll callback, wich is called everytime when the user scrolls up or down. If you want to run a specific code only one time (at the beginning), you can use a flag to do that, such as:
var flag = true;
$.jInvertScroll(....., onScroll: function(perc) { if(flag == true) { // do whatever you want flag = false; } });
If you need further assistance, do not hesitate to ask! ;-)