ideasvacuum Posted September 25, 2018 Share Posted September 25, 2018 I have used this example, embedding the CSS and JS in the HTML file to display one SlideShow: https://www.w3schools.com/howto/howto_js_slideshow.asp For multiple SlideShows I have given each a different class name. .....but I don't know how to add a switch into each slide control function to avoid having a separate set of functions for every SlideShow. Link to comment Share on other sites More sharing options...
Funce Posted September 25, 2018 Share Posted September 25, 2018 (edited) You could pass along the SlideShow's ID as an argument. That's the most simple way. (Instead using separate IDs rather than classes) Edited September 25, 2018 by Funce Link to comment Share on other sites More sharing options...
ideasvacuum Posted September 25, 2018 Author Share Posted September 25, 2018 Tried working with IDs but there are so many individual items that need to be independent - could not get my head around it and so I have given each SlideShow item a unique name and each SlideShow has it's own control functions (two functions each) Link to comment Share on other sites More sharing options...
dsonesuk Posted September 25, 2018 Share Posted September 25, 2018 Do a search for 'multiple' in this forum, this has been asked for multiple times. Link to comment Share on other sites More sharing options...
ideasvacuum Posted September 25, 2018 Author Share Posted September 25, 2018 The nearest solution is https://www.w3schools.com/code/tryit.asp?filename=FOAHR2CXN2V8 ...but because it's structured differently to the w3 example, when I add numbers and captions, they fail. At the end of the day, I like the way I have done it, based on the w3 example with tweaks (no dots, better prev/next for my site) because I understand it Link to comment Share on other sites More sharing options...
dsonesuk Posted September 25, 2018 Share Posted September 25, 2018 You should have done it the other way round, the linked example does not use captions or numbers so "mySlides" and "fade" classes where added to images only. as these classes control the sliding to next image and fade in and out, just adding these to a container div which would hold images, numbered div and caption div as you currently have, would make it work! but as you want till stay with your current method, cause you can understand it! lets leave it that then. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now