留言板

Cannot read property 'apply' of undefined"

l ll,修改在8 年前。

Cannot read property 'apply' of undefined"

Regular Member 帖子: 158 加入日期: 11-12-12 最近的帖子
Hello!


       var cell = A.all("#cels div");
	cell.hover(function(e) {
		this.setStyle('border', '5px solid #555');
    });


In the console, persistent errors : "Uncaught TypeError: Cannot read property 'apply' of undefined"
In what may be the reason?
l ll,修改在8 年前。

RE: Cannot read property 'apply' of undefined"

Regular Member 帖子: 158 加入日期: 11-12-12 最近的帖子
Noticed errors occur when leaving the cell cursor
thumbnail
Julien Mourad,修改在8 年前。

RE: Cannot read property 'apply' of undefined" (答复)

Junior Member 帖子: 78 加入日期: 15-1-22 最近的帖子
The hover method takes 2 parameters, one for mouse over and one for mouse out. Your code is missing the mouse out function hence the error.
http://alloyui.com/api/classes/A.Node.html#method_hover


cell.hover(function(){
    console.log("mouseover");
}, function(){
    console.log("mouseout");
});
l ll,修改在8 年前。

RE: Cannot read property 'apply' of undefined"

Regular Member 帖子: 158 加入日期: 11-12-12 最近的帖子
Thank you!
thumbnail
David H Nebinger,修改在8 年前。

RE: Cannot read property 'apply' of undefined"

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Perhaps there was no match for "#cels div". Personally I'd wonder if maybe the "cels" was misspelled, but not sure.