Smart Preloader - Free jQuery Image Preload Plugin » Blackhat Forum

BHD Forum

Introduce yourself in the Great BHTDownloads Forum
Click Here...

Upgrade to VPS!

Get access to all the Best Marketing Software and Tutorials
Click Here...

Black Hat VPS

Xrumer, Scrapebox, Facebooker, TweetCeo, Senuke X and More!
Click Here...

Earn Money With Us

Become Our Affiliate and Earn Up To 70% Per Sale!
Click Here...

Smart Preloader - Free jQuery Image Preload Plugin 


Smart Preloader - Free jQuery Image Preload Plugin


Smart Preloader - Free jQuery Image Preload Plugin


Smart Preloader is a small jQuery image preloading plugin that helps you preload all the required images. Smart perloader plugin takes an array of images and notifies via "oneachimageload" on each image load, and once all the images are loaded "onloadall" callback functions is called. Both the "oneachimageload" and "onloadall" functions are passed as parameters to Smart Preloader initializer function.

Smart Preloader parameters

images: an array of images to be preloaded
oneachimageload: callback function to be called on each image load
onloadall: callback function to b called when all the images are loaded

Using Smart Preloader

In your HTML file add the following in the head section.

Add a reference to latest jQuery script
Add a reference to smartpreload.js file

Now add the following code to your HTML file’s head section.

<script type="text/javascript">       $(document).ready(function() :      $(document).smartpreload({ images: ['comma separated list of image paths'], oneachimageload: onimageload, onloadall: onallimagesloaded });           function onimageload(src)          {              //write your code here              //alert(src);          }          function onallimagesloaded()          {              //write your code here          }      });  </script>


Here is the complete source code for a demonstration of image preloading. In this demo we are loading twelve images, initially when the page loads it displays an overlay and the place holders for images and on each image load the place holder is replaced with actual image, once all the images are loaded the overlay is also removed.








Related News

You are not logged in or registered on BHTDownloads!

Please Register Here!

Add a Comment

Name:
E-Mail: