Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery infinite scroll - scroll bar on div not body

I found a demo of infinite scroll using the masonry plugin.

http://www.jquery4u.com/demos/infinite-scrolling-demo1/

What I would like to do is place the scroll bar on the container div. So the body will remain static.

Is this possible? Please let me know if you need me to explain further.

Thanks

like image 907
James Aspden Avatar asked Oct 08 '22 04:10

James Aspden


1 Answers

Here's a simple example of what you are trying to do:

  • http://www.stevefenton.co.uk/cmsfiles/assets/File/infinitescroller.html

Container <div> CSS:

<style type="text/css">
  /* Optional styles */ 
  #infinitescroller {
  background-color: White;
  width: 50%;
  height: 200px;
}
</style>

Container <div> HTML:

<div id="infinitescroller">
  <div>
    <p>Starting content</p>
  </div>
</div>
like image 65
JohnB Avatar answered Oct 12 '22 21:10

JohnB