Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Normally when you would like to make a user aware of something you use an alert. Now say I would like to do that but in a Android toast like way, namely a popup that shows up on screen, but then a few seconds later disappears by itself so the user don't have to be bothered, like the image below.

How could something like this be achieved in the web? (Doing a touch interface so thats the reason I would like to have it in this way)

Thanks =)

enter image description here

share|improve this question

2 Answers

The easier way is to make a holder where you put your message. That holder will be hidden.

<div class='error' style='display:none'>Event Created</div>

Then with a simple script you can show it for a few seconds.

$('.error').fadeIn(400).delay(3000).fadeOut(400); //fade out after 3 seconds

Example

share|improve this answer

You have some good libraries on internet to mimic the native android toast message:

Basically is a div with the message with some CSS and an animation to show and hide.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.