Wednesday, 21 August 2013

How to do auto scroll in div contend using iscroll?

How to do auto scroll in div contend using iscroll?

I have one div In which I have some contend coming from server .I take
some Height of div .I need to start auto scroll of div contend.Start
scrolling own.Actually when I am not using iscroll library I using doing
like this.
var elem = document.getElementById('realTimeContents');// just to scroll
down the line
elem.scrollTop = elem.scrollHeight;
But now I am using iscroll library it is not work.
secondly how to get event when user goes to end of contend .I want to get
event . When I am not using iscroll library I am getting the result but
when I am using this library I am not getting that event .
$('#scroller').bind('scroll', function()
{
if($(this).scrollTop() +
$(this).innerHeight()>=$(this)[0].scrollHeight)
{
alert('end reached');
}
})

No comments:

Post a Comment