Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto hide message bar after some interval #6

Open
mindscratch opened this issue Jun 28, 2011 · 3 comments
Open

Auto hide message bar after some interval #6

mindscratch opened this issue Jun 28, 2011 · 3 comments

Comments

@mindscratch
Copy link
Owner

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.

@JonTheNiceGuy
Copy link

I'm no Javascript expert (or intermediate, or... well, any good really) but, perhaps:

function DelayedHide() {
$('body').messagebar('hide');
}
function DelayHide() {
setTimeout("DelayedHide()", 3000);
}

@mindscratch
Copy link
Owner Author

@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?

@JonTheNiceGuy
Copy link

That's what the "DelayHide()" function is there for. It'll run the "DelayedHide()" function after 3000ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants