Copy link to clipboard
Copied
Hi All,
I'm creating a basic computer skills assessment. I want instructions to be available to users while completing tasks, and I want them to be able to move them around or close them. I programmed a smartshape button with JavaScript (see end of post for script) to open a pop-up window with the instructions. This is mostly great.
My users will have variable levels of computer skills, and I'm concerned that they won't all recognize that they should close that pop-up before moving on to the next task. They would end up with 30 open pop-ups. I want that pop-up to close automatically when users move on to a new task. Executing JavaScript seems like the most logical way to do that, but I'm struggling with how to get it to close the pop-up, not the project window.
Is JavaScript the best way to do this? If not, any suggestions? If yes, how do I write that script? I'm ok being pointed to resources to figure this out, too.
Clearly, I have no experience with JS and am not a programmer. I've Googled a lot, but nothing sticks out as a solution for me here. Thank you in advance for your help!
open window script:
window.open("","Instructions","width=600,height=200,left=900,top=300").document.write("");
When you open the window you need to put it in a variable, then wirte to the window.
var myWindow = window.open("","Instructions","width=600,height=200,left=900,top=300");
myWindow.document.write("Instructions");
Then to close it:
myWindow.close();
Copy link to clipboard
Copied
When you open the window you need to put it in a variable, then wirte to the window.
var myWindow = window.open("","Instructions","width=600,height=200,left=900,top=300");
myWindow.document.write("Instructions");
Then to close it:
myWindow.close();
Copy link to clipboard
Copied
SUCCESS! Thank you so much for the quick and helpful reply!