Skip to main content
Participant
October 19, 2019
Question

All my buttons link to the same URL

  • October 19, 2019
  • 1 reply
  • 295 views

using Animate (version 19.2.1) I have created several buttons using this action :

this.***.addEventListener("click", fl_ClickToGoToWebPage);
 
function fl_ClickToGoToWebPage() {
window.open("https://www.***********/", "_top");
}
it works well but all my buttons goes to the same url despite having edited the url and the button name eachtime.
all the buttons follow this action:
ps: I have also tried to put it online and it doesn't work in wordpress either
 
Does anyone know this problem ? thanks in advance for the help 🙂
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
October 19, 2019

if you use the snippets, you need different button listeners calling different functions, if you want to use different urls.  eg.

 

this.button_1.addEventListener("click",gotoURL_1.bind(this));

this.button_2.addEventListener("click",gotoURL_2.bind(this));

 

function gotoURL_1(){

window.open("http://www.adobe.com");

}

function gotoURL_2(){
window.open("http://www.kglad.com");
}

Participant
October 19, 2019

thank you very much !

kglad
Community Expert
Community Expert
October 19, 2019

you're welcome.