<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
<title>无标题文档</title>
<styletype="text/css">
<>
</style>
<scripttype="text/javascript">
<>
</script>
</head>
<body>
<divid="pic"onmousedown="getmouseposition(event)"onmouseup="setmouseposition(event)"></div>
今天在玩googleearth4.0b,发现PrintScreen下来的图片很大,如果直接放在网页上,因为尺寸太大又不合适,又不想压缩图片的尺寸,于是乎就想到了这种方法,没想到实现起来比预想的要容易。呵呵,该死的是,这段代码还兼容firefox。
</body>
</html>
今天在玩googleearth4.0b,发现PrintScreen下来的图片很大,如果放在网页不合适,又不想压缩图片的尺寸,于是乎就想到了这种方法,没想到实现起来比预想的要容易。呵呵,该死的是,这段代码还兼容firefox。
--------------------------------------------------------------------------------------
2006.6.20修改:
·添加了滚动的范围,不会出现背景
·用到onmousemove事件,图片实时随鼠标移动而移动
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
<title>无标题文档</title>
<styletype="text/css">
<>
</style>
<scripttype="text/javascript">
<>
</script>
</head>
<body>
<divid="pic"onmousedown="getmouseposition(event)"onmousemove="movestart(event)"onmouseup="movestop()"onmouseout="movestop()"></div>
</body>
</html>