0

we have the facebox script loaded onto our website, Im trying to figure out how to grab hold of the close event so that we can force the page to reload if the user closes the dialog.

We are doing this because the user will have adjusted their order on another page and we would like this to display to inform them we are aware of their change.

My code is as follows, but it doesnt seem to grab hold of the event when the user clicks the close button.

$.facebox.close(function(){
    alert('this is working');
    location.reload();
});

any ideas greatly appreciated, BTW, this is the library we are using

https://github.com/defunkt/facebox

4

1 回答 1

0

Add this after calling the facebox

 jQuery(document).ready(function($) {
      $('a[rel*=facebox]').facebox({
        loadingImage : '../src/loading.gif',
        closeImage   : '../src/closelabel.png'
      });
      // add this
      $(document).bind('close.facebox', function() {
        alert('this is working');
         location.reload();
      });

    })
于 2013-08-13T03:46:46.500 回答