WordPress.org

Support

Support » Plugins and Hacks » Hacks » Different Close WIndow for page in Thickbox

Different Close WIndow for page in Thickbox

  • I have a page which from some pages is opened in a new tab, but can be opened in a Thickbox from elsewhere. I want to include a ‘Close Window’ link, but this needs to be different for the tab version and the Thickbox 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='self.tb_remove();'>Close Window</a>");}
    </script>
    `

    which writes the two versions correctly.

    The tab version closes as expected, but the Thickbox version doesn’t.

    I’ve tried removing ‘self.’ to make it {document.write("<a href='tb_remove();'>Close Window</a>");}
    but that doesn’t work either.

    I’m not greatly experienced so if this is something blindingly obvious please excuse my ignorance.

    (An alternative would be to ignore the ‘Close Window’ link in the Thickbox version and just rely on the ‘close’ button in the title bar, but I can’t find a way to make the title bar black and it looks nasty white.)

    http://ipcst.org/blog/?page_id=45 click the first thumbnail for the Thickbox version.
    http://www.ipcst.org/projects.htm click ‘Taquara’ on the left for the tab version.

    Patrick Cunningham

  • The topic ‘Different Close WIndow for page in Thickbox’ is closed to new replies.