Skip to content

Instantly share code, notes, and snippets.

@maksimerohin
Last active September 3, 2019 05:05
Show Gist options
  • Save maksimerohin/757ec923a2aa26b2f0c4f4b9eb164101 to your computer and use it in GitHub Desktop.
Save maksimerohin/757ec923a2aa26b2f0c4f4b9eb164101 to your computer and use it in GitHub Desktop.
События для контактных форм Contact Form 7
document.addEventListener( 'wpcf7mailsent', function( event ) {
if ( '376' == event.detail.contactFormId ) {
$('#contact-modal .form').slideUp(function() {
$('#contact-modal .result').slideDown();
});
console.log("FORMSENT");
yaCounter51427798.reachGoal('FORMSENT');
};
});
document.addEventListener( 'wpcf7mailsent', function( event ) {
if ( '376' == event.detail.contactFormId ) {
$('#contact-modal .form').slideUp(function() {
$('#contact-modal .result').slideDown();
});
try {
yaCounter51427798.reachGoal('FORMSENT');
} catch(e) {
alert('Ошибка ' + e.name + ":" + e.message + "\n" + e.stack); // (3) <--
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment