Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
63
rated 0 times [  66] [ 3]  / answers: 1 / hits: 6490  / 10 Years ago, fri, february 21, 2014, 12:00:00

I am using Magnific Popup.



I want to close popup when click anywhere on page close popup.



Here is my code fiddle:



http://jsfiddle.net/qweWa/24/



Code :



$('.popup-modal').magnificPopup({

type: 'inline',
modal: true,

});

$(document).on('click', '.closePopup', function (e)
{
e.preventDefault();
$.magnificPopup.close();
});

More From » jquery

 Answers
17

Slight adjustment ,check fiddle :)




$('.popup-modal').magnificPopup({



type: 'inline',
modal: false,


});




> $(document).on('click', '.closePopup', function (e) 
> {
> e.preventDefault();
> $.magnificPopup.close();
> });


http://jsfiddle.net/qweWa/27/


[#47535] Thursday, February 20, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
yosefleod

Total Points: 113
Total Questions: 100
Total Answers: 115

Location: Egypt
Member since Tue, May 3, 2022
2 Years ago
;