【问题标题】:Mouse Cursor - for wordpress site [closed]鼠标光标 - 用于 wordpress 网站 [关闭]
【发布时间】:2012-09-09 14:28:16
【问题描述】:

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

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

【问题讨论】:

  • 你没有问问题,你只是说出了你想要的。

标签: javascript jquery wordpress plugins cursor


【解决方案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);   
});
});

`

【讨论】:

  • 非常感谢您的帮助。我是将其插入到 wordpress 中索引文件的顶部还是单独的文本文件中?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-05
  • 1970-01-01
  • 2015-02-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多