我对 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 中工作,但想留在进入和离开。