Jump to content

How to create jQuery info/pop-up boxes


Dan06

Recommended Posts

I'd like to display a message box that fades in, remains for a few seconds, and then fades out. Additionally, I'd like the box to have only a message/image, no prompts, i.e. ok, cancel, etc.

 

Does anyone have any examples for or tutorials of what I've described using jQuery?

Link to comment
https://forums.phpfreaks.com/topic/133559-how-to-create-jquery-infopop-up-boxes/
Share on other sites

I'd like to display a message box that fades in, remains for a few seconds, and then fades out. Additionally, I'd like the box to have only a message/image, no prompts, i.e. ok, cancel, etc.

 

Does anyone have any examples for or tutorials of what I've described using jQuery?

 

I don't know of any tutorials that combine all of the behaviors you want, but I'm pretty sure it's possible.  Your best bet may be to combine jQuery's effects (easiest are show and hide: http://docs.jquery.com/Effects) with JavaScript's own setTimeout function.  Something like (this is pseudo-code):

 

On page load, show the box:

$(document).ready(function()
{
   $("#myBoxId").show();

 

Set the time out:

   var timeoutHandle = setTimeout("$('#myBoxId').hide()", 5000); //hide after 5 seconds
});

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.