<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>
<body>
<img src="1.jpg" id="image">
<script>
// 设置延时保证图片加载完成
setTimeout(function() {
var
real_width,
real_height,
_im = document.getElementById('image'),
im = document.createElement('img');
im.src = _im.src,
real_width = im.width,
real_height = im.height;
alert(real_width+'\n'+real_height);
},500);
</script>
<script language="javascript" type="text/javascript">
function m(){
//alert(event.clientX);
//alert(event.clientY);
}
m();
</script>
<p id="area" style="padding:90px;border:1px solid #ccc;font-size:36px;width:800px;height:600px;" onmousemove="m();"> test</p>
</body>
</html>