🤯 60% OFF BLACK FRIDAY SALE 650+ books, courses & coding assessments!

Photofy.js – jQuery Random Photo Plugin

Sam Deering


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();


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


<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 -->