Hi!
I would like to insert a button to let a window close.
Please, take a look at: http://www.giorgiodellarole.com/it/ascolti6.html
Cliking on the “play” blue buttons on the left, you can reach a new window with a video running.
I would like that window to close automatically when I open a new one.
I tried with the action option “close automatically”, but it seems not to work.
I think it would be enough to have a X button…
How can I do?
Thanks!
Andrea DF
If you want a “click to close window” text link, or a graphic “X” button that when clicked closes the window, add the text or graphic and then apply a hyperlink to it…in the hyper link dialog box select “external” then for protocol select javascript, then enter this;
window.close()
This will make a link or apply a link to a graphic that will close the window when clicked…not sure how to make a window close automatically.
Just so you know, you can only close a window using JavaScript when it is not a user-created window. That is to say, if the use chose File / New Window in their browser, you will find that a window.close() script will not close it. If the window in question was opened using JavaScript or a target=_blank link, then you are free to close it.
Walter
On Dec 12, 2011, at 9:37 AM, ANDREA DALLA FONTANA wrote:
Hi Rich, thanks a lot!
A X button is definitely enough!
Ciao!
Andrea
Hi Richard, Hi Walt and thanx for your answers. I’m sorry, but I am not that expert with technical terminology (that’s why I am an enthusiastic FWPro user!).
So, should the window.close work if I opened the window with a “open in a new window” action?
Thanx and good work!
Andrea
Yes it should work that way. I use it when I have a link to a pop up type window. For example on a main website, there is a “click here to watch this video” link, when clicked a smaller window with the video pops open…then on that small window I put the java script to close.
What Walt is is saying is, if you were to the copy the url (web address) for that small pop up window, and open a new browser window, and then paste the url into the new window, the java script close window won’t work. In fact I just tried it.