For some reason my previous post was removed? Anyhow, I am a web designer and not a programmer but I am learning javascript.
So, if I am creating a slideshow with thumbnails, where when a user clicks on a thumbnail it displays a large image.
document.getelementbyid("thumbnail1").onclick = largeimage1
This code brings a large image for that particular thumbnail. So to bring a different image for another thumbnail I have to rewrite this code all over again.
But is there a way to write a universal code that no matter what thumbnail you click on it would bring the appropriate large image.
So, if I am creating a slideshow with thumbnails, where when a user clicks on a thumbnail it displays a large image.
document.getelementbyid("thumbnail1").onclick = largeimage1
This code brings a large image for that particular thumbnail. So to bring a different image for another thumbnail I have to rewrite this code all over again.
But is there a way to write a universal code that no matter what thumbnail you click on it would bring the appropriate large image.