ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > RocketCake
forum topic indicator Slideshow Random Order ?
person icon
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?

person icon
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;
}


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

Thanks a lot, niko!! That works emoji icon_smile

person icon
ivarforkbeard
Registered User
Quote
2024-10-26 16:57:25

While I don't mind doing this, do you think it might be a nice option to have right within RocketCake? Surely there's enough people who would want a random slideshow order?

person icon
niko
Moderator
Quote
2024-10-27 06:43:42

Sure, why not!

person icon
ivarforkbeard
Registered User
Quote
2024-10-27 18:00:42

Tagging onto this - although it sounds like you might already implement it, but if we were to manually edit the javascript files, when we go to publish the site again, wouldn't that overwrite our custom versions?

I haven't tried it yet, I figure asking the question is easier than experimenting - sorry!

person icon
micaelo
Registered User
Quote
2024-10-27 18:49:57

when we go to publish the site again, wouldn't that overwrite our custom versions?

Yes, re-publishing will overwrite your custom version. However, if your changes do not involve changes to the image gallery you can save your custom version by just re-naming it. Then, after the re-publish is done, just delete the newly generated gallery script, and re-name your custom version back to its default file name.


Create reply:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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