I was looking for a way to manually scroll to position (in my case the bottom).
The following code was used to create this option:
var $_fn_scrollz = $.fn.scrollz;
$.fn.scrollz = function (method) {
// method scroll to *;
if (method === "scrollTo") {
// scroll container to new location;
$(this).data("markup").container.animate({ scrollTop: arguments[1] || 0 }, { duration: 750, easing: 'easeOutCubic' });
} else if (method === "scrollToBottom") { // method scroll to bottom;
// scrollz container;
var container = $(this).data("markup").container,
offset = 3; // 3 pixels offset to take into account;
// scroll container to new location;
container.stop().animate({ scrollTop: container.get(0).scrollHeight - container.height() - offset }, { duration: 750, easing: 'easeOutCubic' });
} else {
// execute original code;
$_fn_scrollz.apply(this, arguments);
}
};
Maybe you can use the code above to add this in.
Only issue I was having sometimes is that with infinity scrolling (using bottomreached event to add data and the scrolling to the bottom again), this could create a loop.
I was looking for a way to manually scroll to position (in my case the bottom).
The following code was used to create this option:
Maybe you can use the code above to add this in.
Only issue I was having sometimes is that with infinity scrolling (using
bottomreached
event to add data and the scrolling to the bottom again), this could create a loop.