Note that there are some explanatory texts on larger screens.

plurals
  1. POonmouseout not firing properly
    primarykey
    data
    text
    <p>I have this code which is supposed to fire on mouseover and it's counterpart to do the opposite on onmouseout:</p> <pre><code>colinc(); function colinc(){ var hexnum=number.toString(16); var hexcolor="#"+hexnum+hexnum+hexnum; document.getElementById("c"+x).style.backgroundColor=hexcolor; number=number+8; if(number&lt;=184) setTimeout(colinc,50); } </code></pre> <p>The counter part only has the change of number = number-8; and number>=40; The problem is i have multiple boxes that should light up with color change on mouseover and lightdown with mouseout. when i move slowly over my boxes(large in no.) then everything is ok but when i move quickly some boxes do not light down...it looks like the onmouseout doesn't happen if i pass very quickly. Any help?</p> <pre><code>function flash(x){ number=0; var cc = document.getElementById("c"+x); var cs=document.defaultView.getComputedStyle(cc,null); var bg=cs.getPropertyValue('background-color'); var str=""+bg; var n=str.replace("rgb",""); n=n.replace("(",""); n=n.replace(")",""); var arr=n.split(","); number=parseInt(arr[0]); colinc(); function colinc(){ var hexnum=number.toString(16); var hexcolor="#"+hexnum+hexnum+hexnum; document.getElementById("c"+x).style.backgroundColor=hexcolor; number=number+8; if(number&lt;=184) setTimeout(colinc,50); } } function flashe(x){ number=0; var cc = document.getElementById("c"+x); var cs=document.defaultView.getComputedStyle(cc,null); var bg=cs.getPropertyValue('background-color'); var str=""+bg; var n=str.replace("rgb",""); n=n.replace("(",""); n=n.replace(")",""); var arr=n.split(","); number=parseInt(arr[0]); colinc(); function colinc(){ var hexnum=number.toString(16); var hexcolor="#"+hexnum+hexnum+hexnum; document.getElementById("c"+x).style.backgroundColor=hexcolor; number=number-8; if(number&gt;=40) setTimeout(colinc,40); } </code></pre> <p>}</p> <p>This is my full js code</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload