I am trying to have a button that when clicked
#1- Opens a new tab to an external website
#2- Waits 7 seconds
#3- Hides box2 and shows box3
I have been able to get #2 and #3 to work perfectly. However, I am stumped with getting the first part to work correctly. I have searched over the forums here and have found people talking about slightly similar issues but I haven't found a fix. Is there a way to make this work? And I have looked at the API and documentation just not certain if this is possible or I'm just looking at something wrong. Much thanks!
export function button7_click(event) {
// Delays 7 seconds, Hides Box 2 and Reveals Box 3
setTimeout(function() {
$w("#box2").hide();
$w("#box3").show();
}, 7000);
}
Chad, Here it is: export function button7_click(event) { setTimeout(function() { $w("#box2").hide(); $w("#box3").show(); }, 7000); } $w.onReady(function () { $w("#button7").link = "http://insertYourWebsiteHere.com"; $w("#button7").target = "_blank"; }); Best of luck! Nathan
Hello Chad,
i think this won't be possible, because you will directly redirect to the new page. That means, after pressing the button, you can not stay on the current webpage, you will be redirected immediately.
What you can do is....
1) wait 7sec.
2) close boxes
3) redirect to new url