sausage icon indicating copy to clipboard operation
sausage copied to clipboard

i want same like "infinite-scroll next page" mode

Open metalbug opened this issue 12 years ago • 1 comments

$(function() {

/*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

    metalbug avatar Mar 13 '12 04:03 metalbug

    who can help me fix this? http://jsfiddle.net/B5sAk/24/

    metalbug avatar Mar 13 '12 11:03 metalbug