I am trying to get the current mouse position in javascript
with this simple sample code:
$(document).mousemove(function(e){
console.log(e.pageX +', '+ e.pageY);
});
This works fine but I want to get the current mouse position on elements like <object>
. Namely I am using jQuery Media Plugin jQuery.media.js
which generates the proper media element depending on the browser used. With demos like this the console stops logging as long as I stay on the media element. For instance I copy pasted this code:
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery.media.js"></script>
<script>
$(document).ready(function(){
$('.media').media();
});
$(document).mousemove(function(e){
console.log(e.pageX +', '+ e.pageY);
});
</script>
</head>
<body>
<a class="media {width:480, height:280}" href="http://malsup.github.com/video/simpsons.mov">MOV File (video)</a>
</body>
Can I use a different event? Or is this media element not part of $(document)
?