I have the following code which I would like to implement in my WordPress site, in order to have a customized mouse pointer.
where would I insert this code? Into the index.php file itself? Or into a separate text file?
Thank you
$(document).ready(function() {
$(document).mousemove(function(e) {
//create img elements having pointer.png in their src
pointer = $('<img>').attr({'src':'pointer.png'});
//and append them to document
$(document.body).append(pointer);
//show them at mouse position & fade out slowly
pointer.css({
'position':'absolute',
top: e.pageY +2 , //offsets
left: e.pageX +2 //offsets
}).fadeOut(1500);
});
});
There is a
cursorrule in CSS. If you can modify the global CSS somewhere, just addcursor: url(/path/to/cursor.png);tohtmlorbody.