为什么下面的代码不能工作?http://jsbin.com/ayugiq/edit#javascript,html,live
我试着从这个例子中“提取”最简单的elasticOut效果函数:http://dojotoolkit.org/reference-guide/dojo/fx/easing.html (例子在底部)
对不起,我不懒,但这个代码不工作,我找不到任何错误。
发布于 2011-10-25 20:30:13
您需要从以下位置更改要连接到的事件:
dojo.connect(dijit.byId("moveButton"), "onClick", moveIt);
至
dojo.connect(dojo.byId("moveButton"), "onclick", moveIt);
'onClick‘事件仅适用于实际的dijit小部件,而'onclick’事件适用于原生html元素,如<button>。此外,dijit.byId()应该只用于检索实际的小部件,而dojo.byId则检索普通的html DOM节点,比如您正在使用的button。
https://stackoverflow.com/questions/7887977
复制相似问题