We would like to know how to get element position on the page.
<!--from w w w.ja v a 2 s. co m-->
<html>
<head>
<script type="text/javascript" src='http://code.jquery.com/jquery-1.5.2.js'></script>
<script type="text/javascript">
$(document).ready(function(){
$("h1").bind("dblclick", function(e){
var str = "( " + e.pageX + ", " + e.pageY + " )";
$("h1").text("Click happened! " + str);
});
});
</script>
</head>
<body>
<div><h1>header 1</h1></div>
</body>
</html>
The code above is rendered as follows: