Created
May 12, 2010 18:59
-
-
Save ryanflorence/398999 to your computer and use it in GitHub Desktop.
This file contains 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
// assuming #jack is an element | |
// and our samurai class takes | |
// a jQuery selector for the first | |
// argument in the initialize method | |
// instantiate a class instance | |
$('#jack').samurai(); // new Samurai('#jack') | |
// call a method | |
$('#jack').samurai('eat') // jack.eat() | |
// get a property | |
$('#jack').samurai('isAlive'); // jack.isAlive | |
// set a property | |
$('#jack').samurai('kills', 2); // jack.kills = 2 | |
// chain stuff | |
$('#jack').samurai('attack', bob).animate().css(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment