Skip to content

Instantly share code, notes, and snippets.

@SergProduction
Last active August 13, 2016 13:10
Show Gist options
  • Save SergProduction/1967bcd950993c69a829a8d02d470f37 to your computer and use it in GitHub Desktop.
Save SergProduction/1967bcd950993c69a829a8d02d470f37 to your computer and use it in GitHub Desktop.
function initmark(status){
initmarkstatus = status;
console.log('initmark(status)',status);
if (!status){
document.body.onmouseover = function(){};
document.body.onmouseout = function(){};
return
}
var saveFirstStyle = {backgroundColor: null, opacity: null};
function mouseover(e){
if (e.target.parentElement.id == 'operator-pointer') return;
saveFirstStyle.backgroundColor = e.target.style.backgroundColor;
saveFirstStyle.opacity = e.target.style.opacity;
e.target.style.backgroundColor = "#f00";
e.target.style.opacity = "0.5";
}
function mouseout(e){
if (e.target.parentElement.id == 'operator-pointer') return;
e.target.style.backgroundColor = saveFirstStyle.backgroundColor;
e.target.style.opacity = saveFirstStyle.opacity;
}
document.body.onmouseover = mouseover;
document.body.onmouseout = mouseout;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment