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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -