I have searched all over the place, and I am trying to create a function which will run when an event is received, except when the div is scrolled horizontally all the way to the end (to the right).
This is my current function:
document.addEventListener("event-fetch", function() {
$.fn.hasHorizontalScrollBar = function () {
return this[0].clientWidth < this[0].scrollWidth;
}
var datafetchdiv = $('#datafetch');
if (datafetchdiv.hasHorizontalScrollBar()) {
$(rightPaddle).removeClass('hidden');
}
else {
$(rightPaddle).addClass('hidden');
}
});
And this is the part I want to add another check to:
if (datafetchdiv.hasHorizontalScrollBar()) {
$(rightPaddle).removeClass('hidden');
}
This should not run if the div is scrolled all the way to the right. I haven't managed to figure this out.