Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<style>
<!--
#leftright, #topdown{
position:absolute;
left:0;
top:0;
width:1px;
height:1px;
layer-background-color:black;
background-color:black;
z-index:100;
font-size:0;
visibility:hidden;
}
-->
</style>
</head>
<body>
<script type="text/javascript">
<!--
/*
Document crosshair Script-
By Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more free DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
Modified here for NS4+, FF1.0.1+, OP8+, IE5+
by jscheuer1 in http://www.dynamicdrive.com/forums
*/
document.write('<div id="leftright"></div><div id="topdown"></div>')
function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}
var ie=document.all&&!window.opera? document.all : 0
var dom=document.getElementById
if (ie){
leftright.style.width=iecompattest().clientWidth-2+'px'
topdown.style.height=iecompattest().clientHeight-2+'px'
leftright.style.height=0
}
else if (dom){
document.getElementById('leftright').style.width=window.innerWidth+'px'
document.getElementById('topdown').style.height=window.innerHeight+'px'
}
else if (document.layers){
document.leftright.clip.width=window.innerWidth
document.leftright.clip.height=1
document.topdown.clip.width=1
document.topdown.clip.height=window.innerHeight
}
function followmouse1(){
//move cross engine for IE 5+
topdown.style.visibility=leftright.style.visibility='visible'
leftright.style.pixelTop=iecompattest().scrollTop+event.clientY+1
topdown.style.pixelTop=iecompattest().scrollTop
if (event.clientX<iecompattest().clientWidth-2)
topdown.style.pixelLeft=iecompattest().scrollLeft+event.clientX+1
else
topdown.style.pixelLeft=iecompattest().clientWidth-2
}
function followmouse2(e){
if (dom){
//move cross engine for NS 6+
document.getElementById('leftright').style.width=window.innerWidth+'px'
document.getElementById('topdown').style.height=window.innerHeight+'px'
document.getElementById('leftright').style.visibility=document.getElementById('topdown').style.visibility='visible'
document.getElementById('leftright').style.top=e.pageY+'px'
document.getElementById('topdown').style.top=pageYOffset+'px'
document.getElementById('topdown').style.left=e.pageX+'px'
}
else {
//move cross engine for NS 4+
document.leftright.visibility=document.topdown.visibility='visible'
document.leftright.top=e.y+1
document.topdown.top=pageYOffset
document.topdown.left=e.x+1
}
}
if (ie)
document.onmousemove=followmouse1
else if (document.layers||dom){
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=followmouse2
}
function regenerate(){
window.location.reload()
}
function regenerate2(){
setTimeout("window.onresize=regenerate",400)
}
if ((document.all&&!window.print)||document.layers)
//if the user is using IE 4 or NS 4, both NOT IE 5+
window.onload=regenerate2
//-->
</script>
</body>
</html>
Bookmarks