为了账号安全,请及时绑定邮箱和手机立即绑定

求教关于js mouseout和mouseover 的一个问题,具体看下面的情况?

求教关于js mouseout和mouseover 的一个问题,具体看下面的情况?

弑天下 2021-06-09 11:07:29
我这有个页面 我的想法是当鼠标进入‘显示’连接后显示隐藏的div 出去后再影藏但是当鼠标进入的是影藏的div时 该div不影藏 请问该怎么做代码:<!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=gb2312" /><title>mouseover测试</title><style type="text/css"><!--#hdiv{background:#EEEEEE;border-radius:4px;border-shadow:2px;position:absolute;left:10px;top:2opx;width:300px;height:200px;}--></style><script type=text/javascript><!--//--><![CDATA[//><!--function showDiv(){ var hdiv = document.getElementById("hdiv");hdiv.style.display = "block";}function hideDiv(){var hdiv = document.getElementById("hdiv");hdiv.style.display = "none";}//--><!]]></script></head><body><a href="" onMouseover="showDiv()" onMouseout="hideDiv()">显示</a><div id="hdiv" style="display:none">隐藏内容</div></body></html>
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 324 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信