Slan
Slan

Reputation: 560

Automatically close magnific Popup iframe after ajax request result

Here is my code that i am trying

$.post("/Users/AjaxLoginBox", function(data) {
parent.$('#fix_header_wrap').find('#Login_Box').html(data);
//i have tried
parent.$('#Login_Box').find("#timeshare_pulse").trigger("click");
//also
parent.$.magnificPopup.close();
//also
$.magnificPopup.close();
}, "html");

i have tried all but couldn't found any solution some time it gives me error that "$.magnificPopup is undefined". Please somebody help me out.Thanks

Upvotes: 2

Views: 1723

Answers (1)

Slan
Slan

Reputation: 560

I have tried this and my problem get solved

parent.$('.mfp-close').trigger("click");

Upvotes: 3

Related Questions