光标图像的位置

时间:2012-10-01 19:22:16

标签: javascript jquery image wordpress

我有以下代码在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);   
});
});

我已经编辑了图像光标的路径,如下所示:

$(document).ready(function() { 

    $(document).mousemove(function(e) {

            //create img elements having pointer.png in their src 
            pointer = $('<img>').attr({'wp-content/uploads/2012/07/':'meerkat2.gif'});

            //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);   
});
});

有人可能会指出为什么图像来源的路径不正确吗?

0 个答案:

没有答案