Results 1 to 6 of 6

Thread: a menu hide after two seconds but not get hidden at all , well ?

  1. #1
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default a menu hide after two seconds but not get hidden at all , well ?

    I try to do a menu hide after two seconds at
    http://www.poliscarhire.com/hotdeals.php
    but not get hidden at all , well ?
    PLEASE NOTE: I Applied code only to "Contact Us" drop down menu at above page.
    head
    Code:
    <script language="javascript" type="text/javascript">
    function hide(x) {
    	document.getElementById(x).style.visibility='hidden';
    }
    // var timer=null;
    function timerHide(y) {
    	//if (timer != null) {
    	//   clearTimeout(timer);
    	//}
    	timer = setTimeout("hide(y)",2000);
    }
    </script>
    menu
    Code:
    ...</td>
      <td width="112" onmouseover="document.getElementById('hc1').style.visibility='visible';"
    	onmouseout="timerHide('hc1');">
       <a href="" class="noDecor">Contact Us </a><br />
    	<table class="noShow bordertableblack" id="hc1" width="170" border="1" bgcolor="#CCCCCC" >
          <tr>
            <td><a href="../contact.php" class="noDecor">Contact Info</a></td>
          </tr>
          <tr>
            <td><a href="../webform.php" class="noDecor">Contact Web Form</a></td>
          </tr>
          <tr>
            <td><a href="../callyouback.php" class="noDecor">Request call you back</a></td>
          </tr>
        </table></td>
      <td width="136">...

  2. #2
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Try this:
    Code:
    <script type="text/javascript">
    var _ = function(e) { return document.getElementById(e); }
    var hide = function(x) {
    	_(x).style.visibility='hidden';
    }
    // var timer=null;
    var timerHide = function(y) {
    	//if (timer != null) {
    	//   clearTimeout(timer);
    	//}
    	timer = setTimeout("hide("+y+")",2000);
    }
    </script>
    Jeremy | jfein.net

  3. #3
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    what is the "_" mean above ?

  4. #4
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    it does not work either review:
    http://www.poliscarhire.com/hotdeals.php

  5. #5
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    The _ is a function that I made, and put above. What it does is return document.getElementById(x), here's the function:
    Code:
    var _ = function(e) { return document.getElementById(e); }
    Also, this doesn't have to do with anything, but on line 96 in your css file, you've got this:
    Code:
        bordercolor="#000000"
    When it should be:
    Code:
        bordercolor: #000000;
    It also maybe a problem with your other scripts, because in my console I'm getting this:
    Error: makesnake is not defined
    Source File: http://www.poliscarhire.com/hotdeals.php
    Line: 1
    Try this with you script, if it doesn't work. I'll take a closer look:
    Code:
    <script type="text/javascript">
    var _ = function(e) { return document.getElementById(e) };
    var hide = function(x) {
    	_(x).style.visibility='hidden';
    };
    // var timer=null;
    var timer = ""; //if your gonna use the above line, delete this line when your changing
    var timerHide = function(y) {
    	//if (timer != null) {
    	//   clearTimeout(timer);
    	//}
    	timer = setTimeout("hide("+y+")",2000);
    };
    </script>
    Last edited by Nile; 09-19-2008 at 10:45 PM.
    Jeremy | jfein.net

  6. #6
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    No result---menu "contact us" if opened[mouse over] does not close ...
    needed this: var timer9=null; ? I modified css file but nothing ....
    Code:
    <script language="javascript" type="text/javascript">
    
    var _ = function(e) { return document.getElementById(e); }
    var hide = function(x) {
    	_(x).style.visibility='hidden';
    }
    // var timer=null;
    var timerHide9 = function(y) {
    	//if (timer != null) {
    	//   clearTimeout(timer);
    	//}
    	timer9 = setTimeout("hide('+y+')",2000);
    }
    </script>
    Code:
    	<table width="875" border="1" class="t1" bgcolor="#CCCCCC" id="menu">
     <tr align="left" valign="middle">
      <td width="64">
       <a href="../index.php" class="noDecor">Home</a><br />	</td>
      <td width="58">
       <a href="../cars.php" class="noDecor">Cars</a><br />	</td>
      <td width="66">
       <a href="../rates.php" class="noDecor">Rates</a><br />	</td>
      <td width="91">
       <a href="../hotdeals.php" class="noDecor">Hot Deals </a><br />	</td>
      <td width="78">
       <a href="../terms.php" class="noDecor">Terms</a><br />	</td>
      <td width="112" onmouseover="document.getElementById('hc1').style.visibility='visible';" onmouseout="timerHide9('hc1');" >
       <a href="" class="noDecor">Contact Us </a><br />
    	<table class="noShow bordertableblack" id="hc1" width="170" border="1" bgcolor="#CCCCCC" >
          <tr>
            <td><a href="../contact.php" class="noDecor">Contact Info</a></td>
          </tr>
          <tr>
            <td><a href="../webform.php" class="noDecor">Contact Web Form</a></td>
          </tr>
          <tr>
            <td><a href="../callyouback.php" class="noDecor">Request call you back</a></td>
          </tr>
        </table></td>
      <td width="136">
       <a href="../about.php" class="noDecor">About PolisCarHire</a><br />  </td>
      <td width="105" onmouseover="document.getElementById('plumbing').style.visibility='visible';"
    	onmouseout="document.getElementById('plumbing').style.visibility='hidden';">
       <a href="" class="noDecor">Touring Info </a><br />
    	<table class="noShow bordertableblack" id="plumbing" width="220" border="1" bgcolor="#CCCCCC" >
    	<tr><td><a href="../maps.php" class="noDecor">Polis/Pafos/Cyprus Maps</a></td></tr>
    	<tr><td><a href="../links.php" class="noDecor">Polis/Pafos/Cyprus Links</a></td></tr>
    	<tr><td><a href="../accommodation.php" class="noDecor">Polis/Pafos Accommodation</a></td></tr>
    	<tr><td><a href="../polis.php" class="noDecor">Polis Mini Guide</a></td></tr>
    	<tr><td><a href="../pafos.php" class="noDecor">Pafos Mini Guide</a></td></tr>
    	<tr><td><a href="../limassol.php" class="noDecor">Limassol Mini Guide</a></td></tr>
    	<tr><td><a href="../cy.php" class="noDecor">Cyprus Mini Guide</a></td></tr>
    	</table>  </td>
      <td width="107" onmouseover="document.getElementById('hc').style.visibility='visible';"
    	onmouseout="document.getElementById('hc').style.visibility='hidden';">
       <a href="" class="noDecor">LogIns/Registers</a><br />
    	<table class="noShow bordertableblack" id="hc" width="160" border="1" bgcolor="#CCCCCC" >
    	<tr><td><a href="../login.php" class="noDecor">Customer Login</a></td></tr>
    	<tr><td><a href="../aff.php" class="noDecor">Affiliates Login</a></td></tr>
    	<tr><td><a href="../admin.php" class="noDecor">Admin Login</a></td></tr>
    	<tr><td><a href="../logout.php" class="noDecor">Customer LogOut</a></td></tr>
    	<tr><td><a href="../affout.php" class="noDecor">Affiliates LogOut</a></td></tr>
    	<tr><td><a href="../adminout.php" class="noDecor">Admin LogOut</a></td></tr>
    	<tr><td><a href="../register-ac.php" class="noDecor">Account Registation</a></td></tr>
    	<tr><td><a href="../register-aff.php" class="noDecor">Affiliates Registation</a></td></tr>
    	</table>  </td>
     </tr>
    </table>

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
  •