Closing colorbox

Colorbox is a jQuery plugin,Nowadays jquery colorbox plugin is mostly used for displaying content in popup window. But there are still somethings where we stuck. Closing colorbox is one of them.

Colorbox plugin has Close public method for closing the colorbox window. But it depends on your design to show or not the close button. In latest colorbox plugin, you can set “closeButton” property to true/false.

For closing the colorbox window manually, options are as follows:

2. On click of a link or button in colorbox content

3. On click of link or button in colorbox iframe content

After all above given condition, there are another situations also, where we need to opt other way to close the colorbox window.But generally we faced the problem when colorbox in iframe.

But it is not so tricky to close the colorbox window. If you need any type of help in jQuery colorbox plugin or fancybox then write to us. We will try to provide you a solution as soon as possible.

You Might Interested In

2 COMMENTS

  1. Herman says:

    Hi, I have an error when closing color box. Below is my code.

    function OpenForm(url)
    {
    $.colorbox({
    iframe: true,
    href: url,
    innerWidth: “530”,
    innerHeight: “400”,
    fixed: false,
    overlayClose: false
    });
    return false;
    }

    Confirm

    function CloseForm()
    {
    parent.$.fn.colorbox.close();
    }

    Cancel

    I always get the error:
    Uncaught SecurityError: Blocked a frame with origin “null” from accessing a frame with origin “null”. Protocols, domains, and ports must match.

    Please help me solve this problem. Thanks a lot

    Reply
    1. Amit Sonkhiya says:

      Hi Herman
      Sorry for being late. Your code is looking right and it seems cross origin iframe issue. Would you like to send link to your site for further checking?

      Reply

Leave a Reply

Enclose a code block like: <pre><code>Your Code Snippet</code></pre>.