I'm trying to update the shopping cart of my site upon closing a Fancybox instance. I'm 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 you.
I'm trying to update the shopping cart of my site upon closing a Fancybox instance. I'm 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 you.
Share Improve this question asked Mar 14, 2012 at 0:09 jmealyjmealy 5821 gold badge5 silver badges15 bronze badges 2- I don't spot anything wrong. Have you tried doing a simple alert() inside your onClosed function? – tybro0103 Commented Mar 14, 2012 at 0:22
- try this stackoverflow./a/11920579/266644 – mola10 Commented Aug 12, 2012 at 15:47
1 Answer
Reset to default 3Instead of using onClosed use beforeClose or afterClose. Find the API documentation under the Callbacks tab here http://fancyapps./fancybox/#docs.
Moreover, answer by Mottie over here Load new content in Fancybox on Fancybox onClosed event might be helpful.