我的html结构的无限滚动

时间:2014-11-24 06:22:03

标签: javascript jquery ajax infinite-scroll

<div id="container">
<div class="grid" style="width: 259px; left: 0px; top: 8px; position: absolute;">
<img src="http://lorempixel.com/200/200" style="transform: scale(1);">
<div class="PostCrd_Snipet" style="display: block;">ii</div></div>
<div class="grid" style="width: 259px; left: 0px; top: 8px; position: absolute;">
<img src="http://lorempixel.com/200/200" style="transform: scale(1);">
<div class="PostCrd_Snipet" style="display: block;">ii</div></div>
<div class="grid" style="width: 259px; left: 0px; top: 8px; position: absolute;">
<img src="http://lorempixel.com/200/200" style="transform: scale(1);">
<div class="PostCrd_Snipet" style="display: block;">ii</div></div>
<div class="grid" style="width: 259px; left: 0px; top: 8px; position: absolute;">
<img src="http://lorempixel.com/200/200" style="transform: scale(1);">
<div class="PostCrd_Snipet" style="display: block;">ii</div></div>
<div class="grid" style="width: 259px; left: 0px; top: 8px; position: absolute;">
<img src="http://lorempixel.com/200/200" style="transform: scale(1);">
<div class="PostCrd_Snipet" style="display: block;">ii</div></div>
<div class="grid" style="width: 259px; left: 0px; top: 8px; position: absolute;">
<img src="http://lorempixel.com/200/200" style="transform: scale(1);">
<div class="PostCrd_Snipet" style="display: block;">ii</div></div>
<div class="grid" style="width: 259px; left: 0px; top: 8px; position: absolute;">
<img src="http://lorempixel.com/200/200" style="transform: scale(1);">
<div class="PostCrd_Snipet" style="display: block;">ii</div></div>
<div class="grid" style="width: 259px; left: 0px; top: 8px; position: absolute;">
<img src="http://lorempixel.com/200/200" style="transform: scale(1);">
<div class="PostCrd_Snipet" style="display: block;">ii</div></div>
<div class="grid" style="width: 259px; left: 0px; top: 8px; position: absolute;">
<img src="http://lorempixel.com/200/200" style="transform: scale(1);">
<div class="PostCrd_Snipet" style="display: block;">ii</div></div>
</div>

我现在将我的ajax请求分成15个项目。第一次15然后30等等..现在我想使用滚动来启动ajax

请指导我

1 个答案:

答案 0 :(得分:0)

如果您使用Jquery

.scroll()可能会有所帮助

$("selector").scroll(function(){
$.ajax(); // fire ajax here
});