Reputation: 323
I want to create custom cursor image, but it is limited to 32x32, while I need about 300x300 image. So it seems that I need to hide cursor cursor: none
and create custom large div or image, that will be moving with invisible mouse.
The simplest implementation could be:
$(document).on('mousemove', function(e){
$('#custom-cursor').css({
left: e.pageX,
top: e.pageY
});
});
but I have some problems:
Can anyone help me with this?
Upvotes: 3
Views: 1942
Reputation: 1
If Cursor and Text are in the same Color, add z-index: -1 to the cursor. So the cursor is behind the text and lets you select it.
But if the color is not equal the user will see, that the cursor is behind the text.
Upvotes: 0
Reputation: 74420
On modern browsers, you need to use pointer-event
CSS property set to none
:
$(document).on('mousemove', function (e) {
$('#custom-cursor').css({
left: e.pageX,
top: e.pageY,
pointerEvents: 'none'
});
});
Upvotes: 2