0

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

但是,我可能更愿意对光标轨迹使用另一种方法,以便它看起来像这个站点上的光标轨迹(除了猫鼬):

4

1 回答 1

1

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

`

于 2012-09-09T20:20:46.920 回答