jQuery Secure Random Images

Discover my first JQuery plugin...

... only 6.5 Kb!

Use it to randomize a image on each load of the page with a secure cookie logic to don't display always the same image (specially useful with small number of images - min. 3 images require).

Use like this - JS code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script> <script src=" jquery.imgrandom-1.1.js" type="text/javascript"></script> <script type="text/javascript"> $('#random1').imgRandom ({    image_width: 337,    image_height: 506,    // not mandatory if you use the full URL on the image path below    images_path: '/files/blog/imgrandom/',    images: [               [                   'http://www.google.com/',   // link                   'test 1',                   // link title                   '76549543.jpg'              // image or image with path               ],               [                   '/about/',                   'test 2',                   '76549562.jpg'               ],               [                   '/about/',                   'test 3',                   'e010697.jpg'               ],               [                   'http://yahoo.com',                   'test 4',                   '79365635.jpg'               ]            ]});</script>

and the HTML container:

<span id="random1"></span>


Download: jquery.imgrandom-1.1.js

demo here

Commentaires (2) Permalink