jqMessageBar
jqMessageBar copied to clipboard
Auto hide message bar after some interval
For use cases where generally only a single message is shown, it would be helpful to be able to have the message bar auto-hide after some interval.
I'm no Javascript expert (or intermediate, or... well, any good really) but, perhaps:
function DelayedHide() { $('body').messagebar('hide'); } function DelayHide() { setTimeout("DelayedHide()", 3000); }
@JonTheNiceGuy -- you're on the right track. jQuery provides the ability to "hide" (and show) components and even use various effects while doing it. In fact, I'm already doing this when the messagebar is shown and hidden.
What I'm looking to do is make the messagebar hide itself after displaying a message for some amount of time. The current implementation was designed such that the user is expected to click on the messagebar to get rid of it when they're ready to. I'd like to provide the ability for it to do that on its own (per the configuration by the developer using it), make sense?
That's what the "DelayHide()" function is there for. It'll run the "DelayedHide()" function after 3000ms.