1.通过ele.setCapture();设置鼠标事件的抓取。

2,应用可以通过单、双击文字来获取时间。

 

代码如下:

 

<html>
<head>
<title>鼠标事件的抓取</title>
<script language="JavaScript">
// 鼠标事件的抓取
function mouseCapture(){
   ele.setCapture();
}
// 鼠标事件的释放
function showAction(){
   if (event.srcElement.id != "ele")
      ele.style.background = "pink";
   else
      ele.releaseCapture();
}
</script>
</head>
<body>
<h2 onmouseover="style.color='red'"
    onmouseout="style.color='black'">
鼠标事件的抓取</h2>
<hr>
<div >
</form>
</body>
</html>


 

 

 

相关文章:

  • 2022-12-23
  • 2022-02-27
  • 2022-12-23
  • 2021-08-27
  • 2021-07-19
  • 2021-09-02
  • 2021-06-02
猜你喜欢
  • 2021-11-14
  • 2021-08-25
相关资源
相似解决方案