Photofy.js – jQuery Random Photo Plugin

Share this article

photofy

This new little plugin randomizes a collection of images from a parent container or from an image feed, and then randomly displays them with an animated effect. All that’s needed is one line of javascript, a tiny amount of css and of course some images.

The demo created gives the effect of new photos being taken, which is a great idea for photographers. However there are many other uses, as it was first created for an online store where product images are shown on the home screen so that that potential customers were instantly able to see what the site had for sale.

The plugin is made to be easy to use, and fully integrates with jQuery. So to initialize the plugin, you would just do $(“#my-image-wrapper”).photofy();

Demo
Download

jQuery Code

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="/Downloads/jquery-photofy.min.js"></script> 
<script type="text/javascript">
      $(document).ready(function () {
          var myOptions = {
              imagecount: 21,
              images: imageList
          }
          $("#facesPhotoWrapper").photofy(myOptions);
      });
</script>

HTML Code

<div id="facesPhotoWrapper">
        <img src="https://blog.tremaynechrist.co.uk/Downloads/Faces/1.jpg" />
        <img src="https://blog.tremaynechrist.co.uk/Downloads/Faces/2.jpg" />
        <img src="https://blog.tremaynechrist.co.uk/Downloads/Faces/3.jpg" />
        <img src="https://blog.tremaynechrist.co.uk/Downloads/Faces/4.jpg" />
        <img src="https://blog.tremaynechrist.co.uk/Downloads/Faces/5.jpg" />
        <!-- etc -->
</div>
Sam DeeringSam Deering
View Author

Sam Deering has 15+ years of programming and website development experience. He was a website consultant at Console, ABC News, Flight Centre, Sapient Nitro, and the QLD Government and runs a tech blog with over 1 million views per month. Currently, Sam is the Founder of Crypto News, Australia.

display random photosjQuery
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week