View Full Version : Closing the grey box automatically
Rockonmetal
04-02-2008, 07:44 PM
I am using the grey box... Found here
http://orangoo.com/labs/GreyBox/
For the control panel on my site. The form will load up through the page and the user will have their account editted as they wish then once they reach the confirmation page and after a couple of sections (or as soon as they reach it) the greybox will close...
If someone could help me write some script that would do this that would be great. THANKS!
djr33
04-02-2008, 10:05 PM
The close image is located on a div with the class of "close". Somewhere in the mess of Javascripts for the box (in an external file-- it's not in the source), you will find a property something like "on.click(if td==close)", which will then tell you the Javascript command. then again, maybe the command is listed in the documentation-- I didn't look.
Calling a command is easy in javascript, such as making it the event of onclick="" on any element. For automatically doing it, you'll need to create a function that checks when something is done-- I'm not sure what that is. If they submit a form, then you can attach the event to submitting the form, but then again submitting a form would reload the page anyway.
Can you show us a simplified (that is to say you don't need to show us any secure data) version of your admin CP?
Rockonmetal
04-04-2008, 08:19 PM
I'm working on the CP... but I have the page which will close when the form is submitted. This is the very basic version, since I have added the details yet...
<html>
<head>
<!-- Styles -->
</head>
<body>
<?php
//Enter in the junk the user put in to the MySQL database...
?>
You have changed your (item) to (input). In about 5 seconds the page will close, if it doesn't, just click the close button up top...
<!-- Code for closing the window? -->
</body>
</html>
ddietz11
12-03-2009, 03:21 PM
Here's the script to close GreyBox automatically after 5 seconds.
<body onload="self.setTimeout('parent.parent.GB_hide()', 5000);">
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.