2016-08-11 22:05:23 +08:00
|
|
|
/*
|
|
|
|
* Scroll to and focus on element.
|
|
|
|
*/
|
2016-07-22 19:29:01 +08:00
|
|
|
function goToFormElement(input) {
|
2016-07-23 00:02:57 +08:00
|
|
|
$("html, body").stop();
|
2016-07-18 19:16:41 +08:00
|
|
|
$("html, body").animate(
|
|
|
|
{
|
2016-07-22 19:29:01 +08:00
|
|
|
scrollTop: $(input).closest(".form-group").offset().top
|
2016-07-18 19:16:41 +08:00
|
|
|
- ($(".navbar-fixed-top").outerHeight(true)
|
|
|
|
+ $(".navbar-secondary").outerHeight(true)
|
|
|
|
+ $(".alert-dismissable").outerHeight(true))
|
|
|
|
},
|
|
|
|
"slow",
|
2016-07-22 19:29:01 +08:00
|
|
|
function() { $(input).focus(); }
|
2016-07-18 19:16:41 +08:00
|
|
|
);
|
2016-08-26 04:26:53 +08:00
|
|
|
}
|