Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
48
rated 0 times [  55] [ 7]  / answers: 1 / hits: 17502  / 13 Years ago, fri, june 24, 2011, 12:00:00

I want to pass two anonymous functions as arguments for jQuery's hover, like so:



$('element').hover(
function() {
// do stuff on mouseover
},
function() {
// do stuff on mouseout
}
);


It's easy with just one – hover -> – but what is the proper syntax in CoffeeScript for two? I tried ...hover ->, ...hover( ->..., etc. but nothing gets me the above structure.


More From » jquery

 Answers
0

Put parentheses around the anonymous functions.


[#91524] Thursday, June 23, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
deiong

Total Points: 15
Total Questions: 103
Total Answers: 99

Location: Sudan
Member since Thu, May 7, 2020
4 Years ago
;