Giter VIP home page Giter VIP logo

llazy's Introduction

llazy

llazy 是一个非常简单的图片 lazyload 库。无依赖,不需要构建,也没有压缩。

示例就在 index.html 里

兼容到IE8(更低的没测)

使用方法

// if no param 'ops', will use default options
llazy('#cont img');
// post a custom ops
llazy('#cont-hor img', {
	container: '#cont-hor', // default is root
	src: 'data-src', // default is 'data-src'
    onload: function (img) {
        // 可以在这里头操作 img,也可以访问其父节点
        // img.style.backgroundColor = '#f00';
        setTimeout(function () {
            img.className = 'fadeIn';
        }, 100);
    }
});

llazy's People

Contributors

wslx520 avatar

Watchers

 avatar

Forkers

lemoncn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.