Last active
February 10, 2018 06:23
-
-
Save asifsomy/e6c13cdb5cae1118d486 to your computer and use it in GitHub Desktop.
Contact from 7 On Submit, Invalid, Spam, MailSent, Mail Failed JS triggers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div.wpcf7 img.ajax-loader{display:none; margin:5px auto 0;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".wpcf7").on('submit.wpcf', function(e){ | |
$('.form .wpcf7 img.ajax-loader').css('display', 'block'); | |
$('.form .wpcf7 img.ajax-loader').show(); | |
}); | |
$(".wpcf7").on('invalid.wpcf7 spam.wpcf7 mailsent.wpcf7 mailfailed.wpcf7', function(e){ | |
$('.form .wpcf7 img.ajax-loader').hide(); | |
}); | |
$(".wpcf7").on('invalid.wpcf7',function(e){ | |
$('html, body').animate({ | |
scrollTop: $(".wpcf7-not-valid").first().offset().top-30 | |
}, 1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment