Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 鼠标光标-用于wordpress站点_Javascript_Jquery_Wordpress_Plugins_Cursor - Fatal编程技术网

Javascript 鼠标光标-用于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

我目前正在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);   
});
});

然而,我可能更愿意为光标轨迹使用另一种方法,这样它看起来就像这个站点上的光标轨迹(猫鼬除外):

如果您想实现这一点,可以使用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);   
});
});