A JavaScript Library That Makes The Images In Your Website | SmartImages

SmartImages JavaScript library makes the images in your website smarter. It enables you to specify different source URLs for desktop and mobile devices and even distinguish between normal and retina displays.

SmartImages also provide a basic lazy loading functionality that helps reduce the impact of your website’s initial loading. This library has absolutely no dependencies and weighs around 1000 bytes if delivered with gzip compression.

[Animation] 3D Page Flip Images Effect For Vue component | flipbook

How to make use of it:

1. Place the minified of SmartImages.js in the HTML document.

<script src="smartImages.js"></script>

2. Specify the image sources at different breakpoints in the data attributes.

<img
  data-src="desktop.png"
  data-size="980x400"
  data-src-mobile="mobile.png"
  data-size-mobile="320x150"
  data-src-mobile-2x="mobile-2x.png"
  data-size-mobile-2x="640x300"
  data-src-custom="custom.png"
  data-size-custom="750x400"
  data-match-custom="(min-width: 640px) and (max-width: 750px)"
/>

3. If you want to lazy load the image, just add the ‘data-lazy’ attribute to your img tag.

<img
  data-src="desktop.png"
  data-size="980x400"
  data-src-mobile="mobile.png"
  data-size-mobile="320x150"
  data-src-mobile-2x="mobile-2x.png"
  data-size-mobile-2x="640x300"
  data-src-custom="custom.png"
  data-size-custom="750x400"
  data-match-custom="(min-width: 640px) and (max-width: 750px)"
  data-lazy
/>

4. The library also supports background images:

<img
  data-smartImageContainer
  data-src="desktop.png"
  data-size="980x400"
  data-src-mobile="mobile.png"
  data-size-mobile="320x150"
  data-src-mobile-2x="mobile-2x.png"
  data-size-mobile-2x="640x300"
  data-src-custom="custom.png"
  data-size-custom="750x400"
  data-match-custom="(min-width: 640px) and (max-width: 750px)"
  data-lazy
/>

Smart Responsive Image Delivery, SmartImages Plugin/Github


See Demo And Download

Official Website(Paratron): Click Here

This superior jQuery/javascript plugin is developed by Paratron. For extra advanced usage, please go to the official website.

Related Posts

Vector-Graphs-smartGraph

Generating Beautiful Vector Graphs With jQuery | smartGraph

SmartGraph is a free and easy-to-use JavaScript library to create beautiful vector diagrams with many customizations. This plugin allows developers to create dynamic, responsive, draggable vector graphics…

vue-image-slider-transition

Image Slider With 20 Cool Transitions Component | vue-flux

Vue flux is an image slider developed with Vuejs 2 that comes with 20+ nice transitions out of the box. Included transitions 2D transitions Fade: Fades from…

simple-parallax-scrolling

Simple background Image Parallax Scroll Plugin In jQuery

Background parallax effect is a simple jQuery background image without any library. Uses jQuery’s scroll() function to track the scroll event and applies the exact parallax scroll…

bootstrap-color-picker-plugin

Modular Color Picker Plugin for Bootstrap | BS Colorpicker

Bootstrap Colorpicker is a standard color picker plugin for Bootstrap 4. Colorpicker Plugin for Bootstrap 5/4/3 frameworks that allow you to add a color picker to an…

gdpr-iframe-manager-js

GDPR Friendly iFrame Manager In Vanilla JS | iframemanager

IframeMananger is a lightweight JavaScript plug-in that helps you to comply with GDPR by completely removing iframes at first and setting a notice related to that service….

diagonal-slider-anime-js

Diagonal Thumbnails Carousel Slider | Anime.js

Diagonal Slider is a cool mini carousel made with Anime.js JavaScript library. It takes a bunch of pictures and turns them into a circular user interface where…