• Resolved quidger

    (@quidger)


    Is there a way of closing the lightbox apart from clicking on outside or “close” button?

    Also, how do I open a link from inside the lightbox in a normal window? I want to add a link to the main site page.

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author arisoft

    (@arisoft)

    Hello

    The following javascript code closes the lightbox:

    jQuery.fancybox.close()

    Add target=”_top” attribute to anchor element(s) on the page which is loaded into the lightbox. HTML code will look like:

    <a href="PAGE_URL" target="_top">Open in main browser's window</a>

    Thread Starter quidger

    (@quidger)

    Thank you for the answer @arisoft

    The second function works fine, but I struggle with the first one.
    I added custom JC in plugin settings and tried making a button, but it doesn’t work. The code is the following:

    “<input type=”button” id=”butnclick” value=”close” onclick=”jQuery.fancybox.close();”/>”

    Cheers.

    Plugin Author arisoft

    (@arisoft)

    Do you place this button to the page which is loaded into the lightbox? Or it is located on main page? Try to use the following code:

    window.top.jQuery.fancybox.close()

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Closing lightobox’ is closed to new replies.