鼠标光标-用于wordpress网站

Mouse Cursor - for wordpress site

本文关键字:wordpress 网站 用于 光标 鼠标      更新时间:2023-09-26

我目前正在wordpress网站上使用一个插件(http://wordpress.org/extend/plugins/cursor-trail/)

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

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

`