Skip to content

Instantly share code, notes, and snippets.

@trullock
Created September 30, 2013 12:28
Show Gist options
  • Save trullock/6763056 to your computer and use it in GitHub Desktop.
Save trullock/6763056 to your computer and use it in GitHub Desktop.
var focusing = false;
this.$navTxtSearch.focus(function (e) {
if (focusing) {
focusing = false;
return true;
}
focusing = true;
$('html').scrollTop(0);
$('body').scrollTop(0);
me.$navTxtSearch.blur();
me.$navTxtSearch.focus();
window.setTimeout(function() {
$('html').scrollTop(0);
$('body').scrollTop(0);
}, 1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment