Reputation:
Mousemove event stops working when the cursor enters on iframe: example
$(document)
.on('mousemove', function(event) {
console.log(event)
})
is it possible to follow the cursor when it is on iframe area?
Upvotes: 1
Views: 1149
Reputation: 42054
You may use:
$(window).on('mousemove', function (event) {
console.log( event.target.tagName + ': ' + event.type);
});
or:
$(function () {
$(document).on('mousemove', function (event) {
console.log( event.target.tagName + ': ' + event.type);
});
});
Your problem in: $(document).on('mousemove', function (event) {
is:
the event is executed before the dom is ready or the window is loaded.
Upvotes: 0