Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hidden layers hide/show

    i have an option on my site where you click a check box and it expands (shows) a hidden layer.

    Works great, but when you add to the basket the layer hides itself again. I want the layer to stop open until the user clicks the checkbox to hide it.

    Code:
    <style type="text/css">
    
    div#Nav, div#Aud {
    width: 592px;
    font: 200 12px helvetica,sans-serif;
    margin: 0px 0px 0px 0px;
    padding: 3px;
    border: 0px;
    display: none;
    }
    
    .style1 {color: #000000}
    .style2 {font-size: 12px}
    .style3 {FONT-FAMILY: Arial, Helvetica, Sans-Serif; FONT-SIZE: 11px; color: #333333;}
    </style>
    <script type="text/javascript" language="javascript">
    
    function displayPanel(oCheckbox) {
    var bWhich = oCheckbox.checked;
    if (el = document.getElementById(oCheckbox.value))
    el.style.display = (bWhich) ? 'block' : 'none';
    }
    
    </script>
    <SCRIPT>
    <!--
    
    var divSelected;
    var winpop = null;
    
    function menuRollOverChange(divThis,iAction)
      {
      if (divSelected != divThis)
        {
        if (iAction == 1)
          divThis.className="menuitemhover";
        else
          divThis.className="menuitem";
        }
      }
    
    function doclose()
      {
    	if (winpop && !winpop.closed)
    		{
    		winpop.close();
    		winpop = null;
    		}
      }
    
    function setLocation(divItem)
      {
      	try
          {
          var els = document.getElementById('theMenu').getElementsByTagName('DIV');
      	  for(var i=0,j=els.length;i<j;i++)
      	  {
          els[i].className='menuitem';
          }
          if (divItem != null)
            els = document.getElementById(divItem);
          else
            els = document.getElementById('menuItem1');
          
          els.className='menuitemselected'; 
      	  divSelected = els
          }
        catch (Err)
          {
          //Just drop out just in case the elements have not been loaded yet.
          } 
      }
    
    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }
    //-->
    </SCRIPT>
    Code:
     <td width="20" align="left" valign="middle" class="itembox"><label></label>
                                  <input type="checkbox" name="section" value="Nav" onclick="displayPanel(this)" /></td>
                              <td width="130" align="left" valign="middle"><?php echo $row_rsResultsTitles['Car']; ?> <?php echo $row_rsResultsTitles['Type']; ?></a></a></span>
                                  </label></td>
                              <td width="70" align="left" valign="middle"><?php echo $row_rsResultsTitles['Lang']; ?></td>
                              <td width="155" align="left" valign="middle"><?php echo $row_rsResultsTitles['Items']; ?></td>
                              <td width="55" align="left" valign="middle"><?php
    			 //Rob Farrell and Leyon Nevett: add up price and x by currency
                 $number1 = $row_rsResultsTitles['Price'];
    			 $number2 = $row_rsCurrency['Rate'];
                 $newnumber = ($number1 * $number2);
    			 echo $english_format_number = number_format($newnumber, 2, '.', '');
    
    ?></td>
                              <td width="66" align="left" valign="middle">&nbsp;</td>
                              <td width="64" align="left" valign="middle"><a href="<?php echo $PHP_SELF; ?>?imxavl1=true&imxavl1_id=<?php echo $row_rsResultsTitles["ID"]; ?><?php echo arrToString($HTTP_GET_VARS); ?>"><img src="btnADD.gif" alt="alt" width="58" height="21" border="0" /></a></td>
                            </tr>
                          </table>
                          <?php } /*END_PHP_SIRFCIT*/ ?>
                            <br />
                            <table width="100%" border="0" cellspacing="0" cellpadding="4">
                              <tr>
                                <td><div id="Nav">
    <?php do { ?><table width="600" border="0" cellspacing="0" cellpadding="4">
                                      <tr>
                                        <td width="150" class="FormIntroText"><?php echo $row_rsResults['Car']; ?></td>
                                        <td width="70" class="FormIntroText"><?php echo $row_rsResults['Lang']; ?></td>
                                        <td width="155" class="FormIntroText"><?php echo $row_rsResults['Items']; ?></td>
                                        <td width="55" align="left" class="style3"><?php
    			 //Rob Farrell and Leyon Nevett: add up price and x by currency
                 $number1 = $row_rsResults['Price'];
    			 $number2 = $row_rsCurrency['Rate'];
                 $newnumber = ($number1 * $number2);
    			 echo $english_format_number = number_format($newnumber, 2, '.', '');
    
    ?></td>
                                        <td width="66" align="center" class="FormIntroText"><a href="<?php echo $row_rsResults['PDF']; ?>.pdf"><img src="pdf.jpg" width="23" height="22" border="0"></a></td>
                                        <td width="64" align="left"><a href="<?php echo $PHP_SELF; ?>?imxavl2=true&imxavl2_id=<?php echo $row_rsResults["ID"]; ?><?php echo arrToString($HTTP_GET_VARS); ?>"><img src="btnADD.gif" alt="alt" width="58" height="21" border="0" /></a></a></td>
                                      </tr>
                                    </table>
                                  
                                    <?php } while ($row_rsResults = mysql_fetch_assoc($rsResults)); ?>
                                    <br />
                                </div></td>
                              </tr>
                          </table></td>
                      </tr>
                    </table>
                      <table width="100%" border="0" cellpadding="4" cellspacing="0" id="PackResult">
                        <tr>
                          <td align="left" valign="top"><?php /*START_PHP_SIRFCIT*/ if ($row_rsResultsAlt['Type']=="Audio"){ ?>
                            <table width="600" border="0" cellspacing="0" cellpadding="4">
                              <tr>
                                <td width="20" align="left" class="FormIntroText">&nbsp;</td>
                                <td width="130" align="left" class="red style1">Pack/Component</td>
                                <td width="70" align="left" class="red style1">Language</td>
                                <td width="155" align="left" class="red style1">Item Is </td>
                                <td width="55" align="left" class="red style1">Price</td>
                                <td width="66" align="center" class="red style1">View PDF </td>
                                <td width="64" align="center"><a ?></a><span class="red style1">Buy</span></td>
                              </tr>
                            </table>
                            <table width="600" border="0" cellpadding="0" cellspacing="3" bgcolor="#E0E5E8">
                              <tr>
                                <td width="20" align="left" valign="middle" class="Black"><label></label>
                                    <a class="itembox">
                                    <input type="checkbox" name="section" value="Aud" onclick="displayPanel(this)" />
                                  </a></td>
                                <td width="130" align="left" valign="middle"><?php echo $row_Recordset1['Car']; ?> <?php echo $row_Recordset1['Type']; ?><br />
                                    </a></a></span>
                                    </label></td>
                                <td width="70" align="left" valign="middle"><?php echo $row_Recordset1['Lang']; ?></td>
                                <td width="155" align="left" valign="middle"><?php echo $row_Recordset1['Items']; ?></td>
                                <td width="55" align="left" valign="middle"><?php
    			 //Rob Farrell and Leyon Nevett: add up price and x by currency
                 $number1 = $row_Recordset1['Price'];
    			 $number2 = $row_rsCurrency['Rate'];
                 $newnumber = ($number1 * $number2);
    			 echo $english_format_number = number_format($newnumber, 2, '.', '');
    
    ?></td>
                                <td width="66" align="left" valign="middle">&nbsp;</td>
                                <td width="64" align="left" valign="middle"><a href="<?php echo $PHP_SELF; ?>?imxavl3=true&imxavl3_id=<?php echo $row_Recordset1["ID"]; ?><?php echo arrToString($HTTP_GET_VARS); ?>"><img src="btnADD.gif" alt="alt" width="58" height="21" border="0" /></a></td>
                              </tr>
                            </table>
                            <?php } /*END_PHP_SIRFCIT*/ ?>
                              <br />
                              <table width="100%" border="0" cellspacing="0" cellpadding="4">
                                <tr>
                                  <td><div id="Aud">
    <?php do { ?><table width="600" border="0" cellspacing="0" cellpadding="4">
                                        <tr>
                                          <td width="150" align="left" class="FormIntroText"><?php echo $row_rsResultsAlt['Car']; ?></td>
                                          <td width="70" align="left" class="FormIntroText"><?php echo $row_rsResultsAlt['Lang']; ?></td>
                                          <td width="155" align="left" class="FormIntroText"><?php echo $row_rsResultsAlt['Items']; ?></td>
                                          <td width="55" align="left" class="FormIntroText"><?php
    			 //Rob Farrell and Leyon Nevett: add up price and x by currency
                 $number1 = $row_rsResultsAlt['Price'];
    			 $number2 = $row_rsCurrency['Rate'];
                 $newnumber = ($number1 * $number2);
    			 echo $english_format_number = number_format($newnumber, 2, '.', '');
    
    ?></td>
                                          <td width="66" align="center" class="FormIntroText"><a href="<?php echo $row_rsResultsAlt['PDF']; ?>.pdf"><img src="pdf.jpg" width="23" height="22" border="0"></a></td>
                                          <td width="64" align="right"><a href="<?php echo $PHP_SELF; ?>?imxavl4=true&imxavl4_id=<?php echo $row_rsResultsAlt["ID"]; ?><?php echo arrToString($HTTP_GET_VARS); ?>"><img src="btnADD.gif" alt="alt" width="58" height="21" border="0" /></a></a></td>
                                        </tr>
                                    </table>
                                    
                                      <?php } while ($row_rsResultsAlt = mysql_fetch_assoc($rsResultsAlt)); ?>
                                      <br />
                                  </div></td>
                                </tr>
                          </table>
    Last edited by fazzfarrell; 10-18-2006 at 10:32 AM.


 

Posting Permissions

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