lib/appearlazy.js
function reveal(el) {
      if (el.hasChildNodes()) {
        // dealing with a container try and find children
        var els = el.querySelectorAll('[data-src], [data-bkg]');
        var elsl = els.length;
        if (elsl === 0) {
          // node has children, but none have the attributes, so reveal
          // the node itself (use case: div with a background)
          doReveal(el);
        } else {
          for (var j = 0; j < elsl; j++) {
            doReveal(els[j]);
          }
        }
      } else {
        doReveal(el);
      }
    }
function reveal(el) {
      if (el.hasChildNodes()) {
        // dealing with a container try and find children
        var els = el.querySelectorAll('[data-src], [data-bkg]');
        var elsl = els.length;
        if (elsl === 0) {
          // node has children, but none have the attributes, so reveal
          // the node itself (use case: div with a background)
          doReveal(el);
        } else {
          for (var j = 0; j < elsl; j++) {
            doReveal(els[j]);
          }
        }
      } else {
        doReveal(el);
      }
    }
function reveal ( el ) { if ( el . hasChildNodes ( ) ) { // dealing with a container try and find children var els = el . querySelectorAll ( '[data-src], [data-bkg]' ) ; var elsl = els . length ; if ( elsl === 0 ) { // node has children, but none have the attributes, so reveal // the node itself (use case: div with a background) doReveal ( el ) ; } else { for ( var j = 0 ; j < elsl ; j ++ ) { doReveal ( els [ j ] ) ; } } } else { doReveal ( el ) ; } }
find what element to work with, as we support containers of images
find what element to work with as we support containers of images