[Plugin: Shadowbox JS] Closing a Shadowbox
-
I’m using Shadowbox overlay to diplay a .htm page. From some locations the page is opened in a new tab, but it can also be opened in a Shadowbox from elsewhere. I want to include a ‘Close Window’ text link, but this needs to be different for the tab version and the Shadowbox version, so I’ve included the following Javascript:
<script type="text/javascript"> if (self==top) {document.write("<a href='self.close();'>Close Window</a>");} else {document.write("<a href='Shadowbox.close();'>Close Window</a>");} </script>
The tab version closes as expected, but the Shadowbox version doesn’t. The page itself closes, but it leaves the overlay in place – just a black box. I can only close the overlay by clicking outside the Shadowbox or clicking the ‘X’ button. Since the overlay is large, it isn’t obvious to the user to do this.
I’m not greatly experienced so if this is something blindingly obvious please excuse my ignorance.
https://ipcst.org/blog/?page_id=45 click the first thumbnail for the Shadowbox version.
https://www.ipcst.org/projects.htm click ‘Taquara’ on the left for the tab version.I tried using Thickbox Plus before I installed Shadowbox, but I had the same problem. Any help would be deeply appreciated – this is for our charity website, and I’ve wasted far too many hours on it.
Patrick Cunningham
EDIT:
I just realised there was some text black-on-black (so invisible) in the window after the page closed:
“Not FoundThe requested URL /shadowbox.close(); was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.”
- The topic ‘[Plugin: Shadowbox JS] Closing a Shadowbox’ is closed to new replies.