Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > RocketCake
Slideshow Random Order ?

micaelo
Registered User
Quote
2023-09-17 14:49:41

I have put a slideshow on my website. Looks nice and works fine, however, I would prefer if it played the images in random order. Since there is no such option in the slideshow's properties, can I somehow (and how?) tweak the wsp_slideshow script to force the slideshow into random mode?


niko
Moderator
Quote
2023-09-18 10:15:00

That should be easy, open the wsp_slideshow script and find the function

wsp_slideshow.prototype.gotoNextFrame

There is a line looking like this:

++this.currentFrame;


replace it with this:

var oldframe = this.currentFrame;
for(;;)
{
this.currentFrame = Math.floor(Math.random() * (this.images.length -1));
if (oldframe != this.currentFrame)
break;
}



micaelo
Registered User
Quote
2023-09-18 11:51:15

Thanks a lot, niko!! That works


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact