maharg
Technical User
- Mar 21, 2002
- 184
Hi folks,
I am having no joy making this simple mouse event script work in FF.
If anyone could give me a clue what I need to do do make it compat with most modern browsers I'd be very grateful.
Thanks,
Graham
I am having no joy making this simple mouse event script work in FF.
If anyone could give me a clue what I need to do do make it compat with most modern browsers I'd be very grateful.
Thanks,
Graham
Code:
<!doctype html>
<html>
<head>
<script src="[URL unfurl="true"]http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>[/URL]
</head>
<body>
<div style="width:1000px; height:500px; background-color:#dddddd"></div>
<script>
$("div")
.mousedown(function() {
var coorddnx=event.clientX;
var coorddny=event.clientY;
$( this ).append( "Down: x="+coorddnx+", y="+coorddny+"<br>" );
})
.mouseup(function() {
var coordupx=event.clientX;
var coordupy=event.clientY;
$( this ).append( "Up: x="+coordupx+", y="+coordupy+"<br><br>" );
});
</script>
</body>
</html>