Edit: Not a timeout, it should be like active after 2 seconds. Else it disturbs the scroll on focus script.
I have this script here, but would like to have a timeout for 1 or 2 seconds.
document.addEventListener("scroll", function() {
document.activeElement.blur();
});
There should not be an instant blur, else my 'scroll on focus input' will not work. Can anyone help? Thanks already.
$("#myInput").click(function () {
$("html, body").animate({ scrollTop: $("#osb").offset().top }, 300);
return true;
});
<div id="osb">
<div id="osb01">
<input type="text" id="myInput" placeholder="Search.." title="Search">
</div>
</div>