[英]dojo/on with mouseenter, mouseleave not working in Google Chrome
我有dojo / on和处理mouseenter和mouseleave的问题。 它对我不起作用......我准备了示例代码:
<!doctype html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8/dojo/dojo.js" data-dojo-config="async: 1"></script>
</head>
<body>
<div id="test">TEST</div>
</body>
</html>
<script type="text/javascript">
require(["dojo/dom", "dojo/on","dojo/domReady!"], function(dom, on) {
on(dom.byId('test'), 'mouseenter', function() { alert('12'); });
});
</script>
如果您尝试在Chrome中打开它不起作用,虽然如果您在Opera,FF或IE中打开它,它可以正常工作。 我做错了什么或者在mouseenter和mouseleave上还有其他方法可以使用吗? 在Chrome中可以使用,但是想要进入和离开。
使用dojo/mouse
模块的扩展事件 :
require(["dojo/dom", "dojo/on", "dojo/mouse"], function(dom, on, mouse) {
on(dom.byId('test'), mouse.enter, function() { alert('12'); });
});
看看它在这个jsFiddle中是如何工作的: http : //jsfiddle.net/phusick/gUNuC/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.