Jump to content

JS/CSS: short confimation message then have it disappear? (Part 2) [SOLVED]


Guest So Called
 Share

Recommended Posts

Guest So Called

Okay I got my original design problem solved, but good enough is never good enough, and if it isn't broken then why not fix it anyway? The situation is a form that submits to itself, and if everything is okay a confirmation message is displayed. Originally it was just a message, and it disappeared only if the page was refreshed. (There really wasn't any need for that since once the setting is set there's no reason to look at it unless I want to change something else.) In the latest version the confirmation is in a block and the <BODY> has an onLoad set timer which changes the body display property to 'none.' I wonder now what it would take to have a pop-up message that displays for a few seconds then disappears. I mean sort of a box that hovers in the (same) window then disappears, sort of like some AJAX messages do (but I'm sure this does not need AJAX). So how would I do that? I presume it would be very similar to before, only I would use a different block element (currently using TD in a table) and would use CSS to position it in front of the other window contents. Same BODY onLoad timer set display:none. Right? Can you make some suggestions on what to use so I can go read up on that? Thanks!

Edited by So Called
Link to comment
Share on other sites

An element (any element; a div will do) using absolute or fixed positioning (if you have other elements using absolute or fixed positioning: also add a z-index with a high value) should do the trick just fine. I mean, that's what absolute/fixed positioning is for - to escape the normal positioning flow.

Link to comment
Share on other sites

Guest So Called

Yeah, that works! Thanks!

<div id="fade" style="position: absolute; z-index: 1;">

The BODY onLoad plus timer sets ID 'fade' to display:none after 3 seconds. I sometimes don't know why I bother continuing to work on this stuff. It's a custom site written in PHP/MySQL that is in many ways similar to a blog. I'm the only administrator and nobody else ever sees this code operate, since it deals with admin (site) settings. I guess I just can't resist tweaking code! :)

Edited by So Called
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...