Hi Guys hope you can help me
I am using the following AJAX code to get SUB-Buttons.
If no new button is selected I need the main button to revert back to the originally selected main button on mouseout with a timeout function or delay please help.
so the code below works but i need a delay or timout
http://entertainment.iafrica.com/
the above link is what its how its suppost to function.
<script language="JavaScript">
function getXMLHTTP() { //fuction to return the xml http object
var xmlhttp=false;
try{
xmlhttp=new XMLHttpRequest();
}
catch(e) {
try{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
try{
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1){
xmlhttp=false;
}
}
}
return xmlhttp;
}
function getCity(strURL) {
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
document.getElementById('citydiv').innerHTML=req.responseText;
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
}
</script>
<td background="images/button_main.gif" class="hand" onMouseOver="getCity('getButtons.php?city=<?php echo $city;?>');" onMouseOut="getCity('getButtons.php?city=<?php echo $original_city;?>');" onClick="">BUTTON</span></td>