EventUtil.getRelatedTarget()方法

2017-06-19 11:58:00
admin
原创
330
<!DOCTYPE html>
<html>
<head>
    <title>Related Elements Example</title>
    <script type="text/javascript" src="http://code.ybao.org/demo/js/EventUtil.js"></script>
</head>
<body>
    <div id="myDiv" style="background-color:red;height:100px;width:100px">Move the mouse from here to the white</div>
    <script type="text/javascript">
        var div = document.getElementById("myDiv");
        EventUtil.addHandler(div, "mouseout", function(event){
            event = EventUtil.getEvent(event);
            var target = EventUtil.getTarget(event);
            var relatedTarget = EventUtil.getRelatedTarget(event);
            alert("Moused out of " + target.tagName + " to " + relatedTarget.tagName);        
        }); 

    </script>
</body>
</html>
文章分类
联系我们
电话: 18902328227
Email: 2689701946@qq.com
QQ: 2689701946
微信: 18902328227
地址: 广州番禺区繁华路
  • 在线客服
  • 关注微信
  • 联系电话
    • 欢迎咨询
    • 欢迎加入QQ群 303257430
  • 公众号:源宝网络
    • 联系电话及微信号 18902328227