How to use the Fancybox onClose property correctly?
I am trying to update my site's shopping cart after I close my Fancybox instance. I am using Fancybox 1.3.4. Assuming my function is valid, shouldn't the following work?
<script type="text/javascript">
$(function () {
$("a.ProductRollover").fancybox({
'padding':0,
'width': 785,
'height': 554,
'autoScale': false,
'type': 'iframe',
'onClosed': function() {
$('#cart_total').html(json['total']);
}
});
});
</script>
Thank.
+3
source to share
1 answer
Instead of using onClosed use beforeClose or afterClose. Find the API documentation under the Callbacks tab here http://fancyapps.com/fancybox/#docs .
Also, Mottie's answer here Uploading new content to Fancybox on Fancybox onClosed event might be helpful.
+3
source to share