Hi, I'm trying to get it so that a random picture displays from a gallery file one at a time. I'm probably making a basic syntax error somewhere as I'm fairly new to JavaScript/jQuery, but please can someone help? I can't get a picture to display in the div at all. Any help would be great, thanks!!

N.B. the pictures are called e.g. 101.jpg, 102.jpg - so I thought a random number generator would be best to get a random picture.


$(document).ready(function generatePic(){

function randomPicture() {

var min=101;
var max=120;

var picture=Math.floor(Math.random()*(max-min+1))+min;


function bannerDisplay(){
$("#banner").load("pages/gallery/PhotoWall/images/'$picture'.jpg", function(){
$("#banner").fadeIn('600', randomPicture())




<div id="banner"></div>