How do you register the two required functions for .hover when using meteor's Template..events api in coffeescript?
I'm trying something along the lines of:
Template.<template>.events
'hover #elementID': (
(ev) -> console.log 'hello world'
(ev) -> console.log 'bye world'
)
Saimeunt's is correct, but if you want it to be exactly as .hover() jquery uses mouseenter and mouseleave instead. So it'd be:
Template.<template>.events
"mouseenter #elementID": (event, template) ->
console.log "mousehover", event
"mouseleave #elementID": (event, template) ->
console.log "mouseout", event
The correct syntax is something like :
Template.myTemplate.events
"mouseover #elementID": (event, template) ->
console.log "mousehover", event
"mouseout #elementID": (event, template) ->
console.log "mouseout", event
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With