【延迟加载】

ImagesLazyLoad 图片延迟加载效果
http://www.cnblogs.com/cloudgamer/archive/2010/03/03/ImagesLazyLoad.html
Lazyload 延迟加载效果
http://www.cnblogs.com/cloudgamer/archive/2010/02/01/LazyLoad.html

非首屏内容的延迟加载
function loadSecondaryScreen(elem, callback) {

    var $window =  $(window);

    var elemTop = elem.offset().top;

    var viewportH = $window.height();

    var loaded = 0;

    if (elemTop > viewportH) {

        $window.bind('scroll', function() {

            if (loaded == 0) {

                loaded = 1;

                $window.unbind('scroll');

                callback();

            }

        });

    } else {

        callback();

    }

}

你可能感兴趣的:(延迟加载)