Question

So what I am trying to achieve is when the lightbox (using colorbox) closes the page that was behind it refreshes. (so the php variables will update)

  <script>
if(parent.jQuery.colorbox.close()){
window.refresh(); 
   }
  </script>

Currently the lightbox closes but the page doesn't reload so the variables don't update :(

any help would be great:) thank you in advance!

Requested extra Code:)

    jQuery(document).ready(function () {
            jQuery('a.out').colorbox({iframe:true,opacity:0.5,scrolling:false,width:"400px",height:"300px",transition:"none"});
              onClosed: function() { location.reload(true); }
        });
Was it helpful?

Solution

That is because window has no method refresh. Use location.reload(true); instead.

Edit: new code after comment on 2014-02-18 13:40

This code would do the trick:

    $(document).ready(function() {
        $('a.out').colorbox({
            iframe: true,
            opacity: 0.5,
            scrolling: false,
            width: '400px',
            height: '300px',
            transition: 'none',
            onClosed: function() {
                location.reload(true);
            }
        });
    });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top