success: function(data){
$.each(data, function(index, data){
$(".videos").append('<ul><li><div class="videos_image"><a href="pagevideo/"><img src="/media/images/' + data.img + '" width="250" height="180" /></a></div><div class="videos_title">' + data.title + '</div><div class="videos_views"><p> Просмотров:' + data.views +'</p></div></li></ul>');
});
inProcess = false;
num += 10;
}
var num = 20;
var inProcess = false;
$(window).scroll(function(){
if ($(window).scrollTop() + $(window).height() >= $(document).height() && !inProcess ){
$.ajax({
url: 'load.php',
method: 'GET',
dataType:'json',
data: "num="+num,
beforeSend: function(){
inProcess = true;
},
success: function(data){
$.each(data, function(index, data){
$(".videos").append('<ul><li><div class="videos_image"><a href="pagevideo/"<img src="/media/images/' + data.img + '" width="250" height="180" /></a></div><div class="videos_title">' + data.title + '</div><div class="videos_views"><p> Просмотров:' + data.views +'</p></div></li></ul>');
});
inProcess = false;
num += 10;
}
});
}
});
var num = 20;
var inProcess = false;
$(window).scroll(function(){
if ($(window).scrollTop() + $(window).height() >= $(document).height() && !inProcess ){
$.ajax({
url: 'load.php',
method: 'GET',
dataType:'json',
data: "num="+num,
beforeSend: function(){
inProcess = true;
},
success: function(data){
var count = 0;
for(o in data){
count++;
}
If(count > 0){
$.each(data, function(index, data){
$(".videos").append('<ul><li><div class="videos_image"><a href="pagevideo/"<img src="/media/images/' + data.img + '" width="250" height="180" /></a></div><div class="videos_title">' + data.title + '</div><div class="videos_views"><p> Просмотров:' + data.views +'</p></div></li></ul>');
});
inProcess = false;
num += 10;
}
}
});
}
});