0

I am trying to display a couple of div tags located in a list div with a vertical scrollbar. I only want the divs currently visible in the displayport of the list to have display: block, the rest should be hidden until the user scrolls.

The reason is that I am trying to display copious amounts of data which kills the browser if its all shown at the same time.

Here's a live example where you can see what I mean: http://jsfiddle.net/RFr3g/2/

Thanks in advance

Firas Dib
  • 2,743
  • 19
  • 38
  • http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport – mplungjan Sep 14 '13 at 16:01
  • http://upshots.org/javascript/jquery-test-if-element-is-in-viewport-visible-on-screen – mplungjan Sep 14 '13 at 16:03
  • in your fiddle use class instead of id... or rename to unique id's.. and that what you want can you make with js - [Example](http://stackoverflow.com/questions/17895318/show-hide-element-on-scroll-using-javascript-only) – Black Sheep Sep 14 '13 at 16:04
  • @mplungjan: Will those work even if the list overflows? Technically they are within the viewport, but not the viewport of the parent so to speak. – Firas Dib Sep 14 '13 at 16:09

0 Answers0