html实现鼠标悬停变成手型实现方式

时间:2023-03-08 23:10:36
html实现鼠标悬停变成手型实现方式

1、采用a标签实现的方式

 <a href="javascript:void()">内容</a>

2、采用CSS实现的方式

 // 变手形
oElement.style.cursor = "pointer"; // 恢复原样
oElement.style.cursor = "default";

或者

 <div style="cursor:hand">

 <img style="cursor:hand">

 <td style="cursor:hand">

css写法:

   <style>
a.hand:hover {cursor:hand}
</style>

cursor其他取值

   auto                     :标准光标
default :标准箭头
hand :手形光标
wait :等待光标
text :I形光标
vertical-text :水平I形光标
no-drop :不可拖动光标
not-allowed :无效光标
help :?帮助光标
all-scroll :三角方向标
move :移动标
crosshair :十字标
e-resize
n-resize
nw-resize
w-resize
s-resize
se-resize
sw-resize