auto scroll on input enter

by rupesx

HTML

<input type="text" id="autocomplete">

<div></div>

CSS

input{
  position: fixed;
}

div{
  height: 1600px;
  background-color: red;
  width: 100%;
}

JavaScript

$("#autocomplete").keydown(function(e) {
					  var keycode = event.keyCode || event.which;
				    if(keycode == '13') {
				    	console.log('wupar')
					   $('html, body').animate({
	                    	scrollTop: $("body").offset().top
	                	}, 1000);
				    }
				});