PDA

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



leonidassavvides
09-18-2008, 07:50 AM
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

<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

...</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">...

Nile
09-19-2008, 12:30 AM
Try this:


<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>

leonidassavvides
09-19-2008, 08:16 AM
what is the "_" mean above ?

leonidassavvides
09-19-2008, 08:44 AM
it does not work either review:
http://www.poliscarhire.com/hotdeals.php

Nile
09-19-2008, 11:31 AM
The _ is a function that I made, and put above. What it does is return document.getElementById(x), here's the function:


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:


bordercolor="#000000"

When it should be:


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:


<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>

leonidassavvides
10-25-2008, 09:15 PM
No result---menu "contact us" if opened[mouse over] does not close ...
needed this: var timer9=null; ? I modified css file but nothing ....


<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>


<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>