javascript - Target style null when cursor leave the screen on Firefox -
i have issue firefox when cursor leave current window.
in sample of code release old target style, works fine on ie , chrome, not on firefox if cursor leave current window "instance.target.style" undefined.
have done wrong, or firefox choose have different behaviour ?
function widgetgrid_mousemove(domevent,instance) { // target element var target = domevent.target; // release old target if (instance.target && instance.target != target) { instance.target.style.cursor = ""; } // set new target instance.target = domevent.target; // other thing }
try:
instance.target.style.cursor = null;
different browsers check empty variables differently. why practice like:
var instance = instance.target.style.cursor; if (instance === "" || instance === null){ //do something..... }
Comments
Post a Comment