javascript - Loading contents when scrolling -
i have below html table
<table id="label" style="width: 100%;"> <tr id="tr"> <td class='td'> <div class="layout" style="position: absolute; z-index: 1; width: 485px; height: 280px; " onclick="this.style.display='none';"><strong>the internet connection has</strong></div> <iframe src="http://www.youtube.com/embed/w9dtujrptd0?wmode=opaque" frameborder="0" allowfullscreen width="100%" height="100%" ></iframe> </td> <td class='td'> <div class="layout" style="position: absolute; z-index: 1; width: 485px; height: 280px; " onclick="this.style.display='none';"><strong>arsenal vs man city <br> 3-2 <br> 23/5/215 <br> أرسنال ضد مانشيستر سيتي</strong></div> <iframe width="100%" height="100%" src="https://www.youtube.com/embed/adbdowu_lqc?wmode=opaque" frameborder="0" allowfullscreen></iframe> </td> </tr> <tr id="tr"> <td class='td'> <div class="layout" style="position: absolute; z-index: 1; width: 485px; height: 280px; " onclick="this.style.display='none';"><strong>communications' second year</strong></div> <iframe width="100%" height="100%" src="https://www.youtube.com/embed/toace9btsca?wmode=opaque" frameborder="0" allowfullscreen></iframe> </td> <td class='td'> <div class="layout" style="position: absolute; z-index: 1; width: 485px; height: 280px; " onclick="this.style.display='none';"><strong>hello world</strong></div> <iframe width="100%" height="100%" src="https://www.youtube.com/embed/toace9btsca?wmode=opaque" frameborder="0" allowfullscreen></iframe> </td> </tr> <tr id="tr"> <td class='td'><div class="layout" style="position: absolute; z-index: 1; width: 485px; height: 280px; " onclick="this.style.display='none';"><strong>hello world</strong></div> <iframe width="100%" height="100%" src="https://www.youtube.com/embed/toace9btsca?wmode=opaque" frameborder="0" allowfullscreen></iframe> </td> <td class='td'><div class="layout" style="position: absolute; z-index: 1; width: 485px; height: 280px; " onclick="this.style.display='none';"><strong>hello world</strong></div> <iframe width="100%" height="100%" src="https://www.youtube.com/embed/toace9btsca?wmode=opaque" frameborder="0" allowfullscreen></iframe> </td> </tr> <tr id="tr"> <td class='td'><div class="layout" style="position: absolute; z-index: 1; width: 485px; height: 280px; " onclick="this.style.display='none';"><strong>hello world</strong></div> <iframe width="100%" height="100%" src="https://www.youtube.com/embed/toace9btsca?wmode=opaque" frameborder="0" allowfullscreen></iframe> </td> <td class='td'><div class="layout" style="position: absolute; z-index: 1; width: 485px; height: 280px; " onclick="this.style.display='none';"><strong>hello world</strong></div> <iframe width="100%" height="100%" src="https://www.youtube.com/embed/toace9btsca?wmode=opaque" frameborder="0" allowfullscreen></iframe> </td> </tr> <tr id="tr"> <td class='td'><div class="layout" style="position: absolute; z-index: 1; width: 485px; height: 280px; " onclick="this.style.display='none';"><strong>hello world</strong></div> <iframe width="100%" height="100%" src="https://www.youtube.com/embed/toace9btsca?wmode=opaque" frameborder="0" allowfullscreen></iframe> </td> <td class='td'><div class="layout" style="position: absolute; z-index: 1; width: 485px; height: 280px; " onclick="this.style.display='none';"><strong>hello world</strong></div> <iframe width="100%" height="100%" src="https://www.youtube.com/embed/toace9btsca?wmode=opaque" frameborder="0" allowfullscreen></iframe> </td> </tr> </table> i don't want render rows @ once. need display 10 rows @ time , when user scrolls, vertical scroll bar again need add 10 more rows existing 10 rows , on.
basically have static html rows , need render few , add few more on scroll. how can that?
well, since it's static page think can display first 10 rows , hide others.. using js/jquery, need check whether scroll bar reaches bottom of page. using this:
$(window).scroll(function() { if($(window).scrolltop() + $(window).height() == $(document).height()) { alert("bottom!"); //shows next 10 rows here } });
Comments
Post a Comment