Learn to debug!
So that means scrollapi
is undefined. look where it is defined.
var scrollapi = $(".scrollable").data('scrollable');
console.log($(".scrollable").length); // Says it is Zero...sooo hence your problem
console.log($(".scrollable").data('scrollable')); //undefined
So what is the problem? You have no element on the page when this code runs that has the class .scrollable
.