How to trigger an event on MouseOver on the body (ie. the whole preview area)?
• document.on Events.MouseOver, ->• document.body.on Events.MouseOver, ->• document.body.content.on Events.MouseOver, ->• body.on Events.MouseOver, ->• etc., etc.
Can anyone point me towards that magic combination that will get me there? Thanks a ton!
Hey Nick! Document (http://www.w3schools.com/jsref/dom_obj_document.asp) (HTML DOM) doesn't extend EventEmitter (which allows you to do .on / .off on layers in Framer - it's build in that way to make event listeners easier). You need to use HTML add/removeEventListener with DOM-supported events (http://www.w3schools.com/js/js_htmldom_eventlistener.asp).
document.addEventListener "mouseover", ->do whatever
OR using a function as the call handler
printHello = ->print "Hello"
document.addEventListener "mouseover", printHello
Yasss. Makes sense thanks Joshua
Nick Bewley Anytime!
Great explanation Joshua