Closed Thread Icon

Preserved Topic: setTimeout problem (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18326" title="Pages that link to Preserved Topic: setTimeout problem (Page 1 of 1)" rel="nofollow" >Preserved Topic: setTimeout problem <span class="small">(Page 1 of 1)</span>\

 
911
Paranoid (IV) Inmate

From: Stuttgart, Germany
Insane since: Apr 2001

posted posted 10-16-2001 10:50

hi all!

i´ve got a problem with the following functions.(i use some code from http://www.dithered.com´s 1k DHTML API) i want to show some layers after a second and hide `em on mouseout. but i always get some errors.

code:
<script language="javascript">
d=document;l=(d.layers)?1:0;op=navigator.userAgent.toLowerCase().indexOf('opera')!=-1;

function showE(e){if(l)e.visibility='show';else e.style.visibility='visible';}
function hideE(e){if(l)e.visibility='hide';else e.style.visibility='hidden';}

function sE(x){fade=window.setTimeout('showE(x)',2000);}
function hE(x){window.clearTimeout(fade);hideE(x);}
</script>



any ideas?



InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 10-16-2001 12:51

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

911
Paranoid (IV) Inmate

From: Stuttgart, Germany
Insane since: Apr 2001

posted posted 10-16-2001 14:34

here is an example:

code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>xxx</title>
<script language="javascript">
d=document;l=(d.layers)?1:0;op=navigator.userAgent.toLowerCase().indexOf('opera')!=-1;
function showE(e){if(l)e.visibility='show';else e.style.visibility='visible';}
function hideE(e){if(l)e.visibility='hide';else e.style.visibility='hidden';}
function sE(x){
fade = window.setTimeout("showE(x)",2000);
}
function hE(x){
window.clearTimeout(fade);
hideE(x);
}
</script>
</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<div id="layer01" style="top: 0px; left: 0px; position: absolute;"><a href="#" onmouseover="sE(layer02);" onmouseout="hE(layer02)">hossa</a></div>
<div id="layer02" style="top: 20px; left: 0px; position: absolute; visibility: hidden;">hossa</div>
</body>
</html>



EDIT: just removed an nonexisting stylesheet.



[This message has been edited by 911 (edited 10-16-2001).]

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 10-16-2001 19:24

You didn't copy the most important function from 1K DHTML library - gE() function... But, that's not all, you have to modify your code to look like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>xxx</title>
<script language="javascript">
d=document;l=(d.layers)?1:0;op=navigator.userAgent.toLowerCase().indexOf('opera')!=-1;
function gE(e,f){if(l){f=(f)?f:self;var V=f.document.layers;if(V[e])return V[e];for(var W=0;W<V.lengtht=gE(e,V[W++]);return t;}if(d.all)return d.all[e];return d.getElementById(e);}
function showE(e){e=gE(e);if(l)e.visibility='show';else e.style.visibility='visible';}
function hideE(e){e=gE(e);if(l)e.visibility='hide';else e.style.visibility='hidden';}
function sE(x){
fade = window.setTimeout("showE('"+x+"')",2000);
}
function hE(x){
window.clearTimeout(fade);
hideE(x);
}
</script>
</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<div id="layer01" style="top: 0px; left: 0px; position: absolute;"><a href="#" onmouseover="sE('layer02');" onmouseout="hE('layer02')">hossa</a></div>
<div id="layer02" style="top: 20px; left: 0px; position: absolute; visibility: hidden;">hossa</div>
</body>
</html>


InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 10-16-2001 19:24

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

911
Paranoid (IV) Inmate

From: Stuttgart, Germany
Insane since: Apr 2001

posted posted 10-17-2001 09:51

thx max your code works like a champ! ;-)

ini: thx! i´ll work on my skills.

« BackwardsOnwards »

Show Forum Drop Down Menu