How to use picturefill - 1 common examples

To help you get started, we’ve selected a few picturefill examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github odopod / code-library / packages / odo-responsive-images / src / responsive-images.js View on Github external
this._removeImageEntry(placeholder);

    // Now that the DOM is in the final state, see if this image is already loaded.
    if (this.isImageLoaded(img)) {
      setTimeout(this._handleImageLoad.bind(this, {
        target: img,
      }), 30);
    }

    // When the image first loads, add the loaded class and possibly update
    // the background-image property.
    img.addEventListener('load', this._imageLoadHandler, false);
    img.addEventListener('error', this._imageLoadHandler, false);

    // Run picturefill on the new element.
    picturefill({
      elements: [img],
    });
  }

picturefill

A responsive image polyfill.

MIT
Latest version published 6 years ago

Package Health Score

58 / 100
Full package analysis

Popular picturefill functions