Skip to main content

Posts

Showing posts with the label AngularJs scroll

AngularJs scroll to error on submit and scroll to next error on next submit

Howto scroll down to form validation error when form invalid on submits in AngularJs? Use the below link of code to achieve for the same – var elm = $( 'input.ng-invalid select.ng-invalid' ); if (elm.length) {     elm.first().focus(); } OR angular.element( 'input.ng-invalid' ).first().focus(); OR var scrollIntoAppView = function () {     var elt = $( ".ng-invalid" );     if (elt.length) {         $( 'html, body' ).animate({             scrollTop: (elt.first().offset().top)         }, 500);     } } Note : Use this above method on the top of you is submitting method. 2 nd One Issue   - Scroll to first error in jQuery without a warning in JavaScript console I am using below code - $( 'html, body' ).animate({     scrol...