Skip to content

A simple implementation to replace images based on screen resolution.

Notifications You must be signed in to change notification settings

lucasmarqs/imgresponsive.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Responsive image

A simple implementation to replace images based on screen resolution.

It assumes a "loading image" that it will be replaced for the image refered at data-img-* attribute.

Usage

It requires that you include imgresponsive.js at the end of document body. Then you are all set!

Just add .imgresponsive class to your images and define your images path at data-img-* attribute.

<img src="images/loading.jpg" class='imgresponsive'
  data-img-lg="images/image-hashid.large.jpg"
  data-img-md="images/image-hashid.medium.jpg"
  data-img-sm="images/image-hashid.small.jpg" />

Dependencies

For now your application must have jQuery.

You also need livereloadx if you want to start server from the executable server on the root of application.

About

A simple implementation to replace images based on screen resolution.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published