控件添加onclick()和mouseover()事件

jieshao4 2012-11-18 10:32:04
javascript代码:
function hand(h) //鼠标变手型
{
var hh = document.getElementById(h);
hh.style = "cursor:pointer";
}
</script>

<img id="zj2" src="Images/delete.PNG" onclick="shanchu(ziliao2)" onmousemove="hand(zj2)" />
这样做能实现吗???
...全文
1085 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
奇乐二二二 2012-11-18
  • 打赏
  • 举报
回复
img{cursor:pointer}
jieshao4 2012-11-18
  • 打赏
  • 举报
回复
引用 1 楼 p2227 的回复:
变鼠标用css就好了啊
能具体说一下么?我是想在鼠标悬停在<img>上面时变
似梦飞花 2012-11-18
  • 打赏
  • 举报
回复
貌似有错的样子 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script type="text/javascript"> function hand(h) //鼠标变手型 { var hh = document.getElementById(h); hh.style.cursor="pointer"; } </script> </head> <body> <img id="zj2" src="1.jpg" onmousemove="hand('zj2')" /> </body> </html> 这样试试
p2227 2012-11-18
  • 打赏
  • 举报
回复
变鼠标用css就好了啊

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧