Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Is there a way of detecting a mouse click anywhere in the screen?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-language" content="en">
<title>Mouse click test</title>
<script type="text/javascript">
<!--
function popMessage(e) {
if (!e) e = event;
var xPos = yPos = 0;
xPos = (e.pageX) ? e.pageX : e.clientX + document.body.scrollLeft;
yPos = (e.pageY) ? e.pageY : e.clientY + document.body.scrollTop;
nDiv = document.createElement('div');
nDiv.appendChild(document.createTextNode('Div at ' + xPos + ',' + yPos));
nDiv.style.position = 'absolute';
nDiv.style.left = xPos + 'px';
nDiv.style.top = yPos + 'px';
document.getElementsByTagName('body')[0].appendChild(nDiv);
}
document.onclick = popMessage;
//-->
</script>
</head>
<body>
Click anywhere here!
</body>
</html>