关于GIS的读书笔记,随想等,欢迎讨论。
How to execute Oracle PL SQl
Oracle Sql Commmands
ORA-00911 wired problem
Head First Design Paterns Notes 1
Javascript Memory clear up
hexidecimal javascript
GetExactPositionForCursorClick
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script type ="text/javascript" >
function OnMouseMove(e)
{
var moveDiv =document.getElementById ("MoveDiv");
moveDiv.style.left=e.clientX+'px';
moveDiv.style.top=e.clientY+'px';
window.status ="clientX:"+e.clientX+" clientY:"+e.clientY;
var pos={x:e.clientX,y:e.clientY};
var point=getRltPos(pos,moveDiv);
moveDiv.style.left=point.x+'px';
moveDiv.style.top=point.y+'px';
// moveDiv.style.left=e.layerX+"px";
// moveDiv.style.top=e.layerY+"px";
}
//initial value of pos={x:0;y:0}
//absolute postion that you want element to display, uses window as reference
//html element that want to set it's position.
function getRltPos(pos,obj)
{
if (obj!=null&&pos!=null)
{
//we need to caculate all left and top length of parent element, and subtract this value.
if(obj.parentNode!=null)
{
var parentObj=obj.parentNode;
if(parentObj.tagName=="HTML")
{
return pos;
}
else
{
var styl=parentObj.style;
if(styl.left!=""&&styl.position=="absolute")
pos.x-=parseInt(styl.left);
if(styl.top!=""&& styl.position=="absolute")
pos.y-=parseInt(styl.top);
if(parentObj.parentNode!=null)
return getRltPos(pos,parentObj.parentNode);
}
}
}
else
return null;
}
</script>
</head>
<body onclick="OnMouseMove(event);" style ="background-color :Green ;">
<div id="OuterDiv" style="position :absolute ; background-color: Blue ; left:60px; top:60px; width: 522px; height: 411px; z-index :10;">
<div id="InnerDiv" style="position :absolute ; background-color: Fuchsia; left:30px; top:30px; width: 222px; height: 211px; z-index :20;"></div>
<div id="MoveDiv" style="position :absolute ; background-color:Red ; height :70px; width: 70px; z-index :1000;" ></div>
</div>
</body>
</html>
Sample that roll down automatically