Last active
February 22, 2018 22:27
-
-
Save naturallucky/e7eb9702b29a35a1af3e27af1256d600 to your computer and use it in GitHub Desktop.
This file contains 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
function blinkMessageToNotify(message){ | |
var msg = docId("message"); | |
var delStrLen =msg.textContent.length; | |
msg.textContent = msg.textContent + message; | |
delStrLen = msg.textContent.length - delStrLen;//be care for emoji... | |
setTimeout(function(){ | |
msg.textContent = msg.textContent.substr(delStrLen); | |
},12600); | |
} | |
function docId(idname){ | |
return document.getElementById(idname); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
message auto disappear after while on id="message" HTML