Copy link to clipboard
Copied
http://v27.ancestry.higgsy.co.uk/
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.
You can see the javascript if you use View Page Source and then click the myscript.js link on line 6
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
David
Copy link to clipboard
Copied
This forum is about JS in PDF files, not web-pages.
Copy link to clipboard
Copied
How does JS (assuming you mean javascript) run inside a PDF document? I've only been aware of using it in my web pages. If I have really posted this question in the wrong forum can you say which one I should have used? Thanks, David
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now