scinote-web/app/assets/javascripts/sitewide/gestures.js

17 lines
401 B
JavaScript
Raw Normal View History

/*
* Scroll to and focus on element.
*/
function goToFormElement(input) {
2016-07-23 00:02:57 +08:00
$("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(); }
);
}