mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 19:51:01 +08:00
16 lines
401 B
JavaScript
16 lines
401 B
JavaScript
/*
|
|
* Scroll to and focus on element.
|
|
*/
|
|
function goToFormElement(input) {
|
|
$("html, body").stop();
|
|
$("html, body").animate(
|
|
{
|
|
scrollTop: $(input).closest(".form-group").offset().top
|
|
- ($(".navbar-fixed-top").outerHeight(true)
|
|
+ $(".navbar-secondary").outerHeight(true)
|
|
+ $(".alert-dismissable").outerHeight(true))
|
|
},
|
|
"slow",
|
|
function() { $(input).focus(); }
|
|
);
|
|
}
|