This is my code:
jQuery
(function($) {
$(window).load(function(){
$(".bottomWrapperTable").mCustomScrollbar({
axis: "y",
theme: "dark",
scrollbarPosition: "outside",
callbacks: {
whileScrolling: function(){
setScroll(this.mcs.left);
},
onScroll: function() {
setStartEndScroll(this.mcs.leftPct);
}
}
});
});
})(jQuery);
I followed the mCustomScrollar documentation to produce this code.
My question is, why does this function have to be within the immediate funtion even though window.load()
is not called until after the DOM is ready anyway?
I have tried removing the immediate function but appears to not call the function at all.
I also tried putting the code within $(function() {}
but still no luck.
NOTE: I am not encountering a problem, just requesting information on this topic.
Any insight into this would be helpful