Avatar of Refael
Refael
Flag for United States of America asked on

background slideshow autoplay

Hello Experts,

I am trying to figure out how to make this slideshow auto play. Please if you can help. the entire code including the JS file is provided in codrops.

I really like this slideshow yet i have no idea what to change in order to make autoplay. Thank you.
JavaScriptjQuery

Avatar of undefined
Last Comment
Rob

8/22/2022 - Mon
Dejan Vasiljevic

Hi Rafael,

Just add interval like this

var auto = setInterval(1000); // 1000 ms = 1 sec

Open in new window


Thanks,
D.
Refael

ASKER
Hi Dejan Vasiljevic

First, thank you. As I am not a JS pro can you tell me where in the script should i add it?
Dejan Vasiljevic

Well when You download source, there should be CSS/HTML/JS folders with file. Open .js file and at the beginning of the script you will find where the creator defined var(s) variables, and you should just add this code after them, where are variables defined. Probably creator defined toggle class so You can add it after toggle, or instead of it.
Your help has saved me hundreds of hours of internet surfing.
fblack61
Refael

ASKER
I have the JS file opened yet I do not see any defined var(s) variables at the beginning not toggle?
ASKER CERTIFIED SOLUTION
Rob

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Refael

ASKER
Hi Rob Jurd .... Thank you.

It took me some time to understand what you meant.... a wise quick solution I would say :-))

I am guessing there is no other "elegant" solution yet if this works I am happy.

Thank you again.
Refael

ASKER
A quick, yet wise solution :-) Thank you Rob Jurd
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Rob

No problem... The reasons it's not "elegant" is this isn't a plugin that you has configurable options.  More like code someone has posted.  You could modify the object as there is an internal  _navigate() function but currently that isn't accessible from the outside ;)