Make Contact Form 7 scrolling to invalid inputs

If you want that contact form 7 scrolls to invalid inputs, just add the following javascript code to your wordpress theme.


(function($) {
$(document).ready(function(){
//bmo scroll to not valid
$(".wpcf7").on('invalid.wpcf7',function(e){
$('html, body').animate({
scrollTop: $(".wpcf7-not-valid").first().offset().top-30
}, 2000);
});

});
})(jQuery);

Posted in wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

More aboute me
Give me a +


donate my work ♥ → paypal