Skip to content

galaxycats/load-visible-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

jQuery plugin - loadVisibleImages

Usage

Just put

<script src="jquery.load-visible-images" type="text/javascript"></script>

in you HTML-Head.

Now you can call loadVisibleImages() on any jQuery-Object.

Example

<div id="scrollable-div-container">
  <img src="loading-image.gif" data-img-src="the-real-image-src.jpg">
  <img src="loading-image.gif" data-img-src="the-real-image-src.jpg">
  <img src="loading-image.gif" data-img-src="the-real-image-src.jpg">
  <img src="loading-image.gif" data-img-src="the-real-image-src.jpg">
</div>

<script type="text/javascript" charset="utf-8">
  $(document).ready(function() { $('#scrollable-div-container').loadVisibleImages(); });
</script>

So if you div-container is smaller than the images to display and a scrollbar appears, all images will only be loaded if they are visible.

About

load only visible images via jquery

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published