是否可以从字形图标创建自定义光标?
is it possible to create a custom cursor from glyphicon?
我想知道是否可以用字形图标制作自定义光标。我能想到的一种方法是将光标 属性 none 置于正文上方。使用基于 jquery mousemove x,y 坐标的绝对定位将字形 z-index 设置为最高。这是正确的方法还是有任何本地方法?
虽然我没有找到执行此操作的本机方法。
但是 here's 我是如何用 jquery 和 css 属性.
做到的
#test{
width:200px;
height:200px;
cursor:none;
background-color:#ff0000;
}
#mycur{
position:absolute;
z-index:1000;
cursor:none;
}
$("#test").mousemove(function(e){
mycur=$("#mycur");
mycur.css("left",e.offsetX);
mycur.css("top",e.offsetY);
});
<div id="test">
</div>
<i id="mycur" class="fa fa-paint-brush"></i>
我想知道是否可以用字形图标制作自定义光标。我能想到的一种方法是将光标 属性 none 置于正文上方。使用基于 jquery mousemove x,y 坐标的绝对定位将字形 z-index 设置为最高。这是正确的方法还是有任何本地方法?
虽然我没有找到执行此操作的本机方法。 但是 here's 我是如何用 jquery 和 css 属性.
做到的#test{
width:200px;
height:200px;
cursor:none;
background-color:#ff0000;
}
#mycur{
position:absolute;
z-index:1000;
cursor:none;
}
$("#test").mousemove(function(e){
mycur=$("#mycur");
mycur.css("left",e.offsetX);
mycur.css("top",e.offsetY);
});
<div id="test">
</div>
<i id="mycur" class="fa fa-paint-brush"></i>