Results 1 to 4 of 4

Thread: Closing the grey box automatically

  1. #1
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default Closing the grey box automatically

    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!

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default

    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...
    Code:
    <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>

  4. #4
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Don't make it harder than it has to be.

    Here's the script to close GreyBox automatically after 5 seconds.

    <body onload="self.setTimeout('parent.parent.GB_hide()', 5000);">

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •