View Full Version : random image, simple controls gallery
roytje9
03-20-2009, 10:55 AM
1) Script Title: Simple Controls Gallery v1.3
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamici...plegallery.htm
3) Describe problem:
Is it possible for the simpleGallery to load an random image?
ddadmin
03-20-2009, 03:52 PM
Do you mean scramble the actual order of the images (so the 1st image is a different one each time), or retain the order of the images, just load one randomly (ie: 3rd image the first time, 1st image the 2nd etc)?
roytje9
03-22-2009, 01:26 PM
Thanks for your quick response.
retain the order of the images, just load one randomly (ie: 3rd image the first time, 1st image the 2nd, 5th image the 3rd etc.
ddadmin
03-23-2009, 09:21 AM
Sure, just find the below line inside the script:
setting.curimage=(setting.persist)? simpleGallery.routines.getCookie("gallery-"+setting.wrapperid) : 0
and change that to:
setting.curimage=(setting.persist)? simpleGallery.routines.getCookie("gallery-"+setting.wrapperid) : Math.floor(Math.random()*setting.imagearray.length)
roytje9
03-23-2009, 09:33 AM
Thank you for your help i really appreciate it.
Is it also possible to load every image random not just the first one?
roytje9
03-30-2009, 06:11 AM
How is it also possible to scramble the actual order of the images?
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.