Skip to content

handcoding/Responsive-Enhance

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Responsive Enhance

This script will check whether an image is larger than a specified width and load a full resolution image if neccessary.

<img id="demo" src="http://dummyimage.com/400x300" alt="Responsive Image" data-fullsrc="http://dummyimage.com/800x600">
<script>responsiveEnhance(document.getElementById('demo'), 400);</script>

This will replace the image with the image defined in the data-fullsrc when the image is wider than 400 pixels.

About

Javascript to load a larger image where necessary

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%