text: /*!=
      version: 2.0.5
      date: 2016-05-28
      author: 狼族小狈
      github：https://github.com/1340641314/lazyloadImg
  */
  !function(t){"use strict";"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(t):"undefined"!=typeof module&&module.exports?module.exports=t():window.LazyloadImg=t()}(function(){"use strict";function t(t){this.el="[data-src]",this.top=0,this.right=0,this.bottom=0,this.left=0,this.load=function(t){},this.error=function(t){},this.qriginal=!1,this.monitorEvent=["DOMContentLoaded","load","click","touchstart","touchend","haschange","online","pageshow","popstate","resize","storage","mousewheel","scroll"];for(var e in t)this[e]=t[e];this.init()}return t.prototype.init=function(){this.createStyle();var t=this;this.src=function(){return/\[data-([a-z]+)\]$/.exec(t.el)[1]||"src"}(),this.eachDOM=this.eachDOM.bind(this),this.start()},t.prototype.createStyle=function(){var t=document.getElementById("LazyloadImg-style");return t?!1:(t=document.createElement("style"),t.id="LazyloadImg-style",t.type="text/css",t.innerHTML="            .LazyloadImg-qriginal {                -webkit-transition: none!important;                -moz-transition: none!important;                -o-transition: none!important;                transition: none!important;                background-size: cover!important;                background-position: center center!important;                background-repeat: no-repeat!important;            }        ",void document.querySelector("head").appendChild(t))},t.prototype.start=function(){for(var t=this.monitorEvent,e=0;e<t.length;e++)window.addEventListener(t[e],this.eachDOM,!1);this.eachDOM()},t.prototype.eachDOM=function(t){for(var e=document.querySelectorAll(this.el),n=[],r=0;r<e.length;r++)this.testMeet(e[r])===!0&&n.push(e[r]);for(var r=0;r<n.length;r++)this.loadImg(n[r])},t.prototype.testMeet=function(t){var e=t.getBoundingClientRect(),n=t.offsetWidth,r=t.offsetHeight,o=window.innerWidth,i=window.innerHeight,a=!(e.right-this.left<=0&&e.left+n-this.left<=0||e.left+this.right>=o&&e.right+this.right>=n+o),s=!(e.bottom-this.top<=0&&e.top+r-this.top<=0||e.top+this.bottom>=i&&e.bottom+this.bottom>=r+i);return 0!=t.width&&0!=t.height&&a&&s?!0:!1},t.prototype.loadImg=function(t){var e=this,n=t.dataset[this.src],r=new Image;r.src=n,r.addEventListener("load",function(){return e.qriginal?(t.src=e.getTransparent(t.src,t.width,t.height),t.className+=" LazyloadImg-qriginal",t.style.backgroundImage="url("+r.src+")"):t.src=r.src,delete t.dataset[e.src],e.load.call(e,t)},!1),r.addEventListener("error",function(){return e.error.call(e,t)},!1)},t.prototype.getTransparent=function(){var t=document.createElement("canvas");t.getContext("2d").globalAlpha=0;var e={};return function(n,r,o){if(e[n])return e[n];t.width=r,t.height=o;var i=t.toDataURL("image/png");return e[n]=i,i}}(),t.prototype.end=function(){for(var t=this.monitorEvent,e=0;e<t.length;e++)window.removeEventListener(t[e],this.eachDOM,!1)},t});