I want to Show()
an element when my jquery FancyBox is closed. How can I do this?
Is there any close
event?
var urlOfferDetails = $('#OfferDetails').val();
$.ajax({
url: urlOfferDetails,
type: 'POST',
data: { 'offerID': productCode, 'providerId': providerCode },
closeBtn: 'true',
success: function (data) {
$("#loading").hide();
$.fancybox(
{
'href': '#offerPopup',
'content': data,
'hideOnOverlayClick': false,
'hideOnContentClick': false,
'autoScale': false,
'overlayShow': true,
'type': 'iframe'
});
},
error: function (req, status, error) {
},
complete: function () {
$("#loading").hide();
$('.scrollup').hide();
},
});
Add a afterClose key to fancybox as shown below, it will be called once fancybox is closed. Refer docs
var urlOfferDetails = $('#OfferDetails').val();
$.ajax({
url: urlOfferDetails,
type: 'POST',
data: { 'offerID': productCode, 'providerId': providerCode },
closeBtn: 'true',
success: function (data) {
$("#loading").hide();
$.fancybox(
{
'href': '#offerPopup',
'content': data,
'hideOnOverlayClick': false,
'hideOnContentClick': false,
'autoScale': false,
'overlayShow': true,
'type': 'iframe',
'afterClose' : function(){console.log("FancyBox Closed");}
});
},
error: function (req, status, error) {
},
complete: function () {
$("#loading").hide();
$('.scrollup').hide();
},
});