我有以下代码,我想在我的 Wordpress 网站中实现,以便拥有自定义的鼠标指针。
我将在哪里插入此代码?进入 index.php 文件本身?还是放到单独的文本文件中?
谢谢
$(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);
});
});