当我的jquery FancyBox关闭时,我希望Show()
一个元素。我怎么能这样做?
是否有close
个事件?
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();
},
});
答案 0 :(得分:1)
将一个afterClose键添加到fancybox,如下所示,一旦fancybox关闭,它将被调用。请参阅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();
},
});