// Событие после закрытия
D.afterClose(D, $this);
$this.trigger('afterClose');
$('body').css('overflow','auto');
$.cookie('smartCookies', true, {
expires: 7,
path: '/'
});
<script>
$(document).ready(function () {
if (!$.cookie('smartCookies')) {
$(document).mouseleave(function (e) {
function getWindow() {
$('.offer').arcticmodal({
closeOnOverlayClick: true,
closeOnEsc: true
});
};
setTimeout(getWindow, 1);
$.cookie('smartCookies', true, {
expires: 7,
path: '/'
});
});
};
});
</script>
close: function() {
if ($.isFunction(this)) {
modals.each(function() {
$(this).arcticmodal('close');
});
} else {
return this.each(function() {
var $this = modal.getParentEl(this);
if ($this===false) {
$.error('jquery.arcticmodal: Uncorrect call');
return;
}
var D = $this.data('arcticmodal');
// Событие перед закрытием
if (D.beforeClose(D, $this)===false) return;
$this.trigger('beforeClose');
// Показать предыдущие оверлеи
modals.not($this).last().each(function() {
var d = $(this).data('arcticmodal');
d.overlay.block.show();
});
modal.transition(D.overlay.block, 'hide', modals.length>1 ? {type: 'none'} : D.closeEffect);
modal.transition(D.container.block, 'hide', modals.length>1 ? {type: 'none'} : D.closeEffect, function() {
// Событие после закрытия
D.afterClose(D, $this);
$this.trigger('afterClose');
// Если не клонировали - вернём на место
if (!D.clone)
$('#arcticmodalReserve' + D.modalID).replaceWith(D.body.find('>*'));
D.overlay.block.remove();
D.container.block.remove();
$this.data('arcticmodal', null);
if (!$('.arcticmodal-container').length) {
if (D.wrap.data('arcticmodalOverflow'))
D.wrap.css('overflow', D.wrap.data('arcticmodalOverflow'));
D.wrap.css('marginRight', 0);
}
});
if (D.type=='ajax')
D.ajax_request.abort();
modals = modals.not($this);
});
}
},
D.wrap.css('overflow', 'auto');
$('body').css('overflow','auto');
function getCookie(name) {
var matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
$( ".wpcf7-form" ).change(function() {
if(getCookie("formclick") != 1) {
yaCounter45312216.reachGoal('formchange');
ga('send', 'event', 'Лид', 'Изменение формы');
}
var date = new Date(new Date().getTime() + 60 * 60 * 24 * 1000);
document.cookie = "formclick=1; path=/; expires=" + date.toUTCString();
});
function generateAnchorLink($anchor) {
$currentURL = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
$escaped = htmlspecialchars($currentURL, ENT_QUOTES, 'UTF-8');
return $escaped . '#' . $anchor;
}
Use it in the code like that:
<a href="<?php echo generateAnchorLink("baz"); ?>">baz</a>