You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/*This first part is just throwaway code to simulate a lazy loaded page.*/
var pages = [],
ran = 5, $pages = $('.page-set'),
i = 0,
index = 0,
loading = false;
function addPage() {
var h_page = (Math.floor((1000 - 499) * Math.random()) + 500)
$pages.append('
Page ' + (index + 1) + '
');
index++
};
for (i = 0; i < ran; i++) {
addPage(i)
}
$(window).scroll(function() {
if (loading) {
return
}
if ($(window).scrollTop() > $(document).height() - $(window).height() - 200) {
loading = true;
setTimeout(function() {
addPage();
$(window).sausage('draw');
loading = false
},
250)
}
});
/*This is where the plugin is initialized.*/
$(window).sausage();
function t() {
var time = new Date();
return time.getTime()
}
var s = t();
for (var i = 0; i < 50; i++) {
$(window).sausage('draw')
}
$('#out').append((t() - s) + 'ms')
});
this one too complex
i do not understand
The text was updated successfully, but these errors were encountered:
$(function() {
var pages = [],
$pages = $ ('.page-set'),
ran = 5,
i = 0,
index = 0,
loading = false;
function addPage() {
var h_page = (Math.floor((1000 - 499) * Math.random()) + 500)
$pages.append('
index++
};
for (i = 0; i < ran; i++) {$(window).scrollTop() > $ (document).height() - $(window).height() - 200) {
addPage(i)
}
$(window).scroll(function() {
if (loading) {
return
}
if (
loading = true;
setTimeout(function() {
addPage();
$(window).sausage('draw');
loading = false
},
250)
}
});
$(window).sausage();
function t() {
var time = new Date();
return time.getTime()
}
var s = t();
for (var i = 0; i < 50; i++) {
$(window).sausage('draw')
}
$('#out').append((t() - s) + 'ms')
});
this one too complex
i do not understand
The text was updated successfully, but these errors were encountered: