Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] how to work around this?
- From: rdong at advance.net (Roland Dong)
- Subject: [Javascript] how to work around this?
- Date: Wed Jun 29 22:50:31 2005
I can only get the last loop result with the following script. How to work
around this? From Andrew's explanation that this is caused by late
evaluation. Please throw some light on this.
Thanks you.
==================================================
<script type="text/javascript">
startList = function(){
navBar = document.getElementById("nav").rows[0].cells;
var i=0;
for ( x in dthmlNav){
navBar[i].onmouseover=function() {
document.getElementById(x).style.visibility="visible"
}
navBar[i].onmouseout=function() {
TIMEOUT_ID=setTimeout('document.getElementById(x).style.visibility="hidden"'
, 500);
}
document.getElementById(x).onmouseover=function(){
clearTimeout(TIMEOUT_ID);
document.getElementById(x).style.visibility="visible";
}
document.getElementById(x).onmouseout=function(){
TIMEOUT_ID=setTimeout('document.getElementById(x).style.visibility="hidden"'
, 500);
}
i++;
}
===========================================
- References:
- [Javascript] A loop this this script?
- From: Andrew Clover
- [Javascript] A loop this this script?
- Prev by Date: [Javascript] regexp help: matching selectors
- Next by Date: [Javascript] (no subject)
- Previous by thread: [Javascript] A loop this this script?
- Next by thread: [Javascript] Need help determining when remote window closes.
- Index(es):