I have a storyline 360 file that I am publishing as HTML5 and launching using aws. The issue is that the exit button does not close the browser window. I have adjusted the player settings to launch in a new window and that doesn't appear to be working, either. I know that I need to add JS to make the exit button work but I am not sure of the exact script to add. I am using a Chrome browser to test this, btw. Thanks for any help.
Right, that's what I've been using but the clicking the button doesn't close the window even with that JS. I assume this is an issue because the page is launched from my Squarespace website, opening in a new tab that is hosted by aws?
Hi, would you mind telling me where to input this code on Squarespace? How do I link it to an existing button so that it opens up to a new tab? I also am linking to AWS. I have already created a javascript trigger to close the browser. Thanks in advance!
8 Replies
Try changing the Trigger for your Exit button to:
Execute JavaScript
When the user clicks Button 2
In the JavaScript window, enter the following:
window.top.close();
Right, that's what I've been using but the clicking the button doesn't close the window even with that JS. I assume this is an issue because the page is launched from my Squarespace website, opening in a new tab that is hosted by aws?
In your code on your Squarespace site, how are you opening the new tab with the course in it on Amazon Web Services?
I have a direct url from my Squarespace site to open the aws in a new window.
When you open the new tab, do you use a straight HTML link:
<a href="https://www.google.com/" target="_blank">Go to Google</a>
or JavaScript:
<button onclick="Open()">Google</button>
<script>
function Open() {
window.open("https://www.google.com", "_blank");
}
</script>
The reason I ask is because you can only close a tab (window) using JavaScript if it was OPENED using JavaScript.
Brilliant! Yes, that solved it. Thanks so much.
Hi, would you mind telling me where to input this code on Squarespace? How do I link it to an existing button so that it opens up to a new tab? I also am linking to AWS. I have already created a javascript trigger to close the browser. Thanks in advance!
You would put the code on the page which you use to launch the published Storyline course(s); pointed to the story.html file.