Advanced Search

Results 1 to 4 of 4

Thread: DHTML widget Hide command

  1. #1
    Join Date
    Feb 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DHTML widget Hide command

    1) Script Title: DHTML Widget

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/

    3) Describe problem:

    I want to do:

    PHP Code:
    <?php

        
    if (!isset($_POST["bypassdash"])) {
                
    // Not set display it
                
    $displaydash 1;
            } else {    
                if(
    $_POST['bypassdash'] == 1) {
                        
    // Bypass dash is one.  DO not display the dash
                        
    $displaydash 0;
                    } else {
                        
    $displaydash 1;
                    }
            }
        if(
    $displaydash == 1) {
                
    ?>
    <script type='text/javascript'>
        var contentpanel_win=dhtmlwindow.open('layouttableiframecontent', 'iframe', 'index_new.php', 'Dash Panel', 'top=<?php echo $array_dash[0];?>px,left=<?php echo $array_dash[1];?>px,width=<?php echo $array_dash[2];?>px,height=<?php echo $array_dash[3];?>px,resize=1,scrolling=1,center=0', 'recal');
        </script>    
                <?php
            
    } else {
                
    ?>
    <script type='text/javascript'>
        var contentpanel_win=dhtmlwindow.open('layouttableiframecontent', 'iframe', 'index_new.php', 'Dash Panel', 'top=<?php echo $array_dash[0];?>px,left=<?php echo $array_dash[1];?>px,width=<?php echo $array_dash[2];?>px,height=<?php echo $array_dash[3];?>px,resize=1,scrolling=1,center=0', 'recal');
        contentpanel_win.hide()
        </script>    
                <?php
            
    }
            
    ?>
    In general it loads the DHTML window and wont hide it. How do I get it to hide it? I want it to load, but in the background if the conditions are met.

    How can I do that?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,690
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    There is no "in the background" with this script. You either create the window and open it, or you create a link that will create the window and open it. For the one you say you want "in the background" follow the template for Window 4 (Content from a DIV on the page) on the demo page:

    Code:
    <a onclick="divwin=dhtmlwindow.open('divbox', 'div', 'somediv', '#4: DIV Window Title', 'width=450px,height=300px,left=200px,top=150px,resize=1,scrolling=1'); return false" href="#">
      <b>Create/ Open Window 4</b>
    </a>
    Which in your case would be something like:

    PHP Code:
                <?php 
            
    } else { 
                
    ?> 
        <a href="#" onclick="contentpanel_win=dhtmlwindow.open('layouttableiframecontent', 'iframe', 'index_new.php', 'Dash Panel', 'top=<?php echo $array_dash[0];?>px,left=<?php echo $array_dash[1];?>px,width=<?php echo $array_dash[2];?>px,height=<?php echo $array_dash[3];?>px,resize=1,scrolling=1,center=0', 'recal'); return false;">Open Window</a>
                <?php 
            

            
    ?>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Can a hide() event only be called once the page is fully loaded?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,690
    Thanks
    43
    Thanked 3,129 Times in 3,095 Posts
    Blog Entries
    12

    Default

    I don't know. Try it without the PHP just to be sure. However, what's the difference? What are you going to do with that DHTML window in the background? Unless you need it there for tracking or something, why not just wait to open it until the user clicks on a link to do so.

    If, on the other hand you don't want the user to ever see it, just open up a normal iframe on the page with its visibility hidden

    Another thing you could do is launch it normally. Also have a stylesheet on the page that sets the visibility of the main id to hidden with the !important keyword. Then, if and when you want it shown, remove that stylesheet. I'll work out the details later if we need them, gotta run now.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. Replies: 3
    Last Post: 10-13-2012, 08:01 PM
  2. Cool DHTML Tooltip & DHTML Window Widget
    By dhepburn in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 05-31-2009, 09:46 PM
  3. Replies: 1
    Last Post: 09-06-2007, 09:37 PM
  4. Command for widget window
    By dbldee in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 04-20-2007, 11:58 AM
  5. DHTML Window Widget - hide and refresh iframe
    By zorag in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 02-24-2007, 10:50 PM

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
  •