Answer the question
In order to leave comments, you need to log in
How to remove an event from a popup window?
Hello. There is a page (landing). I attached a click to the body and opened a link in a new tab, excluding the main content of the page.
$("body").click(function(){
window.open('http://toster.ru', '_blank');
});
$(".container").click(function(e){
e.stopPropagation();
});
$(".mfp-container").click(function(e){
e.stopPropagation();
});
$('.header__orderBlock_btnLink,.footer__orderBlock_btnLink').magnificPopup({
type:'inline',
removalDelay: 500,
mainClass: 'mfp-fade popup_inline',
showCloseBtn: true,
closeMarkup: '<div class="mfp-close">x</div>',
closeBtnInside: true,
closeOnContentClick: false,
closeOnBgClick: true,
alignTop: false,
fixedContentPos: true,
callbacks: {
open: function () {
$("body").undind('click', clickOnBody);
}
}
});
Answer the question
In order to leave comments, you need to log in
Decided like this:
$('.header__orderBlock_btnLink,.footer__orderBlock_btnLink').magnificPopup({
type:'inline',
removalDelay: 500,
mainClass: 'mfp-fade popup_inline',
showCloseBtn: true,
closeMarkup: '<div class="mfp-close">x</div>',
closeBtnInside: true,
closeOnContentClick: false,
closeOnBgClick: true,
alignTop: false,
fixedContentPos: true,
callbacks: {
open: function () {
$("body").unbind('click');
},
close: function () {
$("body").bind('click', function(){
window.open('http://toster.ru', '_blank');
});
}
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question