Search  

RANDOMIZING A SLIDESHOW/GALLERY

HomeForumsGeneral DiscussionRandomizing A Slideshow/Gallery
31658 asdginc
12 posts
Bought between 10 and 49 items

Does anyone know of a way to easily allow my slideshow image gallery (jpgs) to randomly play rather than in numbered sequence?

Thanks for anyone’s help!

Posted about 1 month ago
34445 sonicsight
226 posts
Referred at least one person Sold between 100 and 1 000 dollars Bought between 1 and 9 items

math.round(math.random()*NumOfPictures);

that will return a random number depending on how many pictures you have.

Posted about 1 month ago
43487 dSKY
443 posts
Exclusive author Author was featured Referred at least one person Sold between 5 000 and 10 000 dollars Bought between 1 and 9 items
math.round(math.random()*NumOfPictures); that will return a random number depending on how many pictures you have.

math goes wit big M
Math.round :)

Posted about 1 month ago
32710 bobocel
2392 posts
Exclusive author Item was featured Author was featured Referred at least one person Reviewer Sold between 50 000 and 100 000 dollars Bought between 1 and 9 items

Array.prototype.randomize = function() {
var i = this.length;
if (i == 0) return;
while (—i) {
var j = Math.floor(Math.random()*(i+1));
var tmp1 = this[i];
var tmp2 = this[j];
this[i] = tmp2;
this[j] = tmp1;
}
return this;
}

//var arr = new Array(1,2,3,4,5,6,7,8,9);
//trace(arr.randomize());

Posted about 1 month ago
37489 kamy
7 posts
Sold between 100 and 1 000 dollars Bought between 1 and 9 items

yee

Posted about 1 month ago
31658 asdginc
12 posts
Bought between 10 and 49 items

OMG .. I would never understand where I am to place that code. Makes me cringe

Posted about 1 month ago
32710 bobocel
2392 posts
Exclusive author Item was featured Author was featured Referred at least one person Reviewer Sold between 50 000 and 100 000 dollars Bought between 1 and 9 items

Then.. “Huston, we have a problem.” :D

Posted about 1 month ago
31658 asdginc
12 posts
Bought between 10 and 49 items

lol.. bobocel, I think you’re right. Do you guys have a link to a good tutorial on maybe a DHTML -based gallery? Holla back!

Posted about 1 month ago
34445 sonicsight
226 posts
Referred at least one person Sold between 100 and 1 000 dollars Bought between 1 and 9 items
Array.prototype.randomize = function() {
var i = this.length;
if (i == 0) return;
while (—i) {
var j = Math.floor(Math.random()*(i+1));
var tmp1 = this[i];
var tmp2 = this[j];
this[i] = tmp2;
this[j] = tmp1;
}
return this;
}

//var arr = new Array(1,2,3,4,5,6,7,8,9);
//trace(arr.randomize());

wow way to complicate the hell out of it bob just plain Math.random() works fine.

Posted about 1 month ago
32710 bobocel
2392 posts
Exclusive author Item was featured Author was featured Referred at least one person Reviewer Sold between 50 000 and 100 000 dollars Bought between 1 and 9 items

With math random there is a chance for the values to repeat, and for some not to play at all.

Posted about 1 month ago