Javascript 鼠标光标-用于wordpress站点
我目前正在wordpress网站()上使用插件Javascript 鼠标光标-用于wordpress站点,javascript,jquery,wordpress,plugins,cursor,Javascript,Jquery,Wordpress,Plugins,Cursor,我目前正在wordpress网站()上使用插件 $(document).ready(function() { $(document).mousemove(function(e) { //create img elements having pointer.png in their src pointer = $('<img>').attr({'src':'pointer.png'}); //a
$(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);
});
});
然而,我可能更愿意为光标轨迹使用另一种方法,这样它看起来就像这个站点上的光标轨迹(猫鼬除外):如果您想实现这一点,可以使用jQuery,就像Tom建议的那样
$(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);
});
});
这方面的代码是:
$(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);
});
});
`
$(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);
});
});
$(文档).ready(函数(){
$(文档).mousemove(函数(e){
//创建在其src中具有pointer.png的img元素
指针=$('
`您没有问任何问题,只是说出了您想要的。非常感谢您的帮助。我是将此文件插入wordpress索引文件的顶部,还是插入单独的文本文件中?
$(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);
});
});