On the above page I have seven buttons. When you hover over any of them the text changes to white and the user is directed to the appropriate page. A simple implementation of a rollover image.
Each img has an ID allocated to it which links to the code which, when the button is hovered over, replaces the image with the over image with the white text, then puts the old image back when the hover is out.
But I have found I must customise the code for each button. Specifically, I have to change the names of the images, variable names and the name of the selector targetting each button. So I end up with seven copies of the same code! Can it perhaps be changed to a function which accepts these changes as parameters?
many thanks in anticipation
This forum is about JS in PDF files, not web-pages.
JS is used in many environments, the most known of which is indeed in web-pages, but certainly not the only one.
You can try StackOverflow, for example.