Created
September 1, 2016 03:51
-
-
Save benbai123/ae7f90da8f2ccafde6045aa98a12bb34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var focuspwTimer, blurpwTimer; | |
function resetPwTimer () { | |
clearTimeout(focuspwTimer); | |
clearTimeout(blurpwTimer); | |
} | |
function focusPw () { | |
resetPwTimer(); | |
focuspwTimer = setTimeout(function () { | |
if (!$('#pwfocusbox')[0]) { | |
$('.cd-user-modal') | |
.append('<div id="pwfocusbox" style="width: 100%; height: 500px;"></div>'); | |
$('.cd-user-modal')[0].scrollTop = 300; | |
} | |
}, 200); | |
} | |
function blurPw () { | |
resetPwTimer(); | |
blurpwTimer = setTimeout(function () { | |
$('#pwfocusbox').remove(); | |
$('.cd-user-modal')[0].scrollTop = 0; | |
}, 50); | |
} | |
$('#cd-login #signin-password') | |
.on('focus', focusPw) | |
.on('blur', blurPw); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment