我有一个页面,其中包含一个表单和几个字段.我的问题如下:
这是我的jQuery:
JQUERY:
$( document ).ready(function() {
// Set Datepicker
$(".datepicker").datepicker();
$("input").focus(function () {
$('html, body').animate({ scrollTop: $(this).offset().top - 25 }, 10);
});
});
Run Code Online (Sandbox Code Playgroud)
链接到小提琴:https: //jsfiddle.net/MauriceT/0qfycgm1/10/
这是我想要避免的:
任何建议将不胜感激.谢谢!