Crafty.bind()

public Function bind(String eventName, Function callback)
eventName

Name of the event to bind to

callback

Method to execute upon event triggered

[Returns]

callback function which can be used for unbind

Binds to a global event. Method will be executed when Crafty.trigger is used with the event name.