Created
November 26, 2009 10:28
-
-
Save kaievns/243381 to your computer and use it in GitHub Desktop.
shared behavior in RightJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parent_removal_behavior = { | |
click: function() { | |
this.parent().hide(); | |
} | |
}; | |
// assigning to css-rules | |
".remove_parent".behave(parent_removal_behavior); | |
".some_other_rule".behave(parent_removal_behavior); | |
// assigning to some specific element directly | |
$('specific-element').on(parent_removal_behavior); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment