Last active
August 29, 2015 14:17
-
-
Save bgadrian/8280cb4f775defe3048d to your computer and use it in GitHub Desktop.
JS HTML Jquery alert on screen auto dissapear
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
/** | |
Add a temporal message to the interface that with auto deleting feature | |
*/ | |
var uiAddMessage = function(text) | |
{ | |
$('<div>'+text+'</div>') | |
.prependTo(this.dom_messages)//$('#parent') | |
.show(100) | |
.delay(3000 + (this.dom_messages.children().length * 700))//we must add time of lots of messages are on | |
.hide(200) | |
.queue(function(){ | |
$(this).stop(true,true).empty().remove(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment