I have this piece of code and the 'view more' buttom gets initiated only when the mouse hovers over it, but I want to initiate the 'view more' button when at the end of the page. Any help on this how to do this?
this.$viewMore.find('input.ow_newsfeed_view_more').hover(function(){
var btn = this;
OW.inProgressNode(this);
self.loadMore(function(){
OW.activateNode(btn);
if ( self.totalItems > self.actionsCount)
{
self.$viewMore.show();
}
});
});
I know that it could be done using this piece of code, but I couldn't do it. Here, the alert('bottom!') works fine, but the 'view more' doesn't gets to initiate.
$(document).ready(function() {
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() == $(document).height()) {
alert("bottom!");
}
});
});