Interactive PDF buttons in browsers
Hello,
I created an interactive PDF, which consists of a main page, where you can click 4 buttons. Each one displays a different image and hides the other buttons when an image is shown. I used a straightforward java script code:
var img = this.getField("Winter_IMG");
if (img.display == display.hidden) {
img.display = display.visible;
} else {
img.display = display.hidden;
}
var button = this.getField("Spring");
if (button.display == display.hidden) {
button.display = display.visible;
} else {
button.display = display.hidden;
}
var button = this.getField("Autumn");
if (button.display == display.hidden) {
button.display = display.visible;
} else {
button.display = display.hidden;
}
var button = this.getField("Summer");
if (button.display == display.hidden) {
button.display = display.visible;
} else {
button.display = display.hidden;
}
var img = this.getField("overlay_af_image");
if (img.display == display.hidden) {
img.display = display.visible;
} else {
img.display = display.hidden;
}
It works as expected, however when I run it in browsers there are some issues. Google chrome seems reliable, although the buttons remain pressed when I click on them to close the image. I need to click somewhere else on the background to make them "get unstuck". Firefox seems not to pop up the images whatsover. When I run it in Edge, the images are showing up, but when I click again on the buttons to hide them - nothing happens. The buttons and the images are defined as fields i.e. buttons. Is there any way to make it functional in browsers? I'd like to share the file on my blog, so ideally it should be compatible with browsers. Can you give me some guidance on workarounds I can use?
Thanks in advance
