Wednesday, 15 February 2012

javascript - Detect if scrolling is possible on a page -


I have a function that adds more content to the container when the viewer scrolls closer to the place where the container is at the end . It works perfectly:

  var elem = $ ('# cont'); Var baw = $ ('body'); $ (Window) .scroll (function () {if (elem.outerHyight () - bo.scrollTop () - 350 & lt; = 0} {for (var i = 0; i <4; i ++) {Elem.append ('

The issue is that there is not enough material to be loaded originally, so it can never be loaded more!

What do I need to do:

I have to find out that the body can not be scrolled so scrolling is possible until I can add content. How can I go about doing this?

You can:

 < Code> while ($ (document). Hi ()   

Object:

No comments:

Post a Comment