当我为使用jQuery的网站写一个插件时,我想知道为什么一些使用脚本的网站会出现这个错误:
Uncaught TypeError: Object #<Object> has no method 'mouseenter'代码:
plugin.setBehavior = function() {
jQuery('#divname').mouseenter(function() {
show();
});
}有没有没有鼠标输入事件的jQuery版本,或者失败的原因是什么?
Thx
发布于 2012-01-17 17:28:20
试试这个:
plugin.setBehavior = function() {
jQuery('#divname').bind("mouseenter",function() {
show();
});
}如果bind不工作,也可以使用live或delegate
https://stackoverflow.com/questions/8892193
复制相似问题