-1

How can I fire mutiple jquery events in the same line in Marionette ItemView?

Eg. If I want to have the same code for click and hover events. I want to do something like -
events: { "click, hover .class1": "doSomething" // Other events }

1. Code above is obviously wrong, how can I make it right?
2. Also, hover doesn't work at all in Marionette ItemView events, on the other hand, click works fine when used individually. Is that a marionette issue?

Vijay Singh
  • 277
  • 1
  • 3
  • 15
  • 1
    You should only ask one question per post. Your first question is a duplicate http://stackoverflow.com/q/10811067/2333214. Your second question might actually help someone in future, but its answer is buried in comments since you asked like this and accepted an answer which only answers the duplicate question. – T J Feb 17 '16 at 04:27

1 Answers1

0

You could just split them up:

events: { 
  "click .class1": "doSomething",
  "hover .class1": "doSomething"
}

hover will not work however, since jquery dropped the support for that in version 1.9.

Tholle
  • 108,070
  • 19
  • 198
  • 189
  • 1
    Ok, also, for the second part - hover, I found - http://jquery.com/upgrade-guide/1.9/#hover-pseudo-event (it says `hover` is no longer supported after jquery 1.9! – Vijay Singh Feb 17 '16 at 01:06
  • @Tholle did you get a notification about my comment on question..? Just wondering how you updated the 3 hour old answer within 3 minutes after my comment on question – T J Feb 17 '16 at 04:37
  • @TJ Yes I did, strangely enough. Thanks for correcting me. – Tholle Feb 17 '16 at 04:39