Noob Question – How do I use same JS twice?
Hi everyone. Im a very basic JS student and im having an issue when trying to use the same JS Gallery twice on the same page. I understand the "theory" behind the explanation of the issue. I can't re-use the same variables twice. I can only think of one solution : changing the variable names, but that would be very unproductive and time consuming. I've read about using a function and calling it again, but I don't understand how to apply that. The code is pretty simple: http://ift.tt/2t5CBR0
The thing is I want to use the html code twice on the page so I can have two slides galleries. So I don't get how would I call (or where) the function to use the code twice…
Can you help me or guide me?
Thank you in advance.
Submitted July 17, 2017 at 03:40AM by Morkelon
via reddit http://ift.tt/2t53m8t