We would like to know how to get event position on page.
<html>
<head>
<script type="text/javascript" src='http://code.jquery.com/jquery-1.5.2.js'></script>
<script type="text/javascript">
$(document).ready(function(){<!--from w w w. j av a 2s . c o m-->
$("div").bind("click", function(e){
var str = "( " + e.pageX + ", " + e.pageY + " )";
console.log( str);
});
});
</script>
<style>
div { width:50px; height:70px; float:left; margin:5px;
background:rgb(255,140,0); cursor:pointer; }
</style>
</head>
<body>
<div>asdf</div>
</body>
</html>
The code above is rendered as follows: