#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    113
    Rep Power
    16

    Parent.$.colorbox.close(); Not Working For Some


    Hi. My client has a whitepapers section and requires viewers to enter their email address before continuing, and it needs to be a pop up.

    I'm using colorbox so that when a viewer goes to the section an iframe popup shows with the email form, that submits and goes to a "thank you page" frame within the colorbox's iframe where it installs a cookie.

    The popup has no close button, no overlay close, so I have a "continue" button within the "thank you" page:
    Code:
    <input id="cboxClose" type="button" value="CONTINUE" />
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script type="text/javascript" src="http://www.domain.com/popscripts/colorbox/jquery.colorbox-min.js"></script>
    
    <script type="text/javascript">
    $("#cboxClose").click(function() {
     parent.$.colorbox.close();
    });
    </script>
    Everything is working fine except a very small percentage of people are getting hung up on the "thank you" frame, and not being able to close the popup window. They click and nothing happens. Could this be caused by a variety of reasons; browser settings, browser add-on/plugin blockers, etc? Or are there just some browsers not able to read the above function? Or maybe because it's a popup containing an iframe? I know there can be a lot of reasons, just needing to tell the client that this may not be something we have control over.

    For the onload popup I have a "if no cookie then click trigger colorbox popup" which works just fine, it's only the close button that isn't working for a few people.

    Thanks!
    Last edited by hominid4; February 19th, 2014 at 11:33 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    67
    Rep Power
    0
    Erg. Do you know what browsers the users are using where it doesn't work? I have a hunch it's IE.

    I could be wrong... but I seem to remember having a similar problem with IE and pop-ups. I think if my function didn't return anything it didn't work... Maybe try putting a

    return true

    in there and see if it works?
    http://kawaii-nation.com (^._.^)ノ
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    113
    Rep Power
    16
    Thanks, I've asked for what the browsers have been and the client said it's mostly IE but some said FireFox, but not sure how accurate that is. I've tried on several different computers (Mac and PC), all the major browsers, a few IE versions, with no problems. So I've pretty much marked it up as "no telling" due to too many factors.

    I've added the script as a window.setTimeout(function() in addition and that seems to be helping. I'll also try the return true as well to see if that helps.

    Thanks again!

IMN logo majestic logo threadwatch logo seochat tools logo