Created
April 5, 2011 09:47
-
-
Save Olical/903349 to your computer and use it in GitHub Desktop.
Examples for sparkjs.co.uk
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
// Add an event listener for clicking the button (an input with a class of toggleButton) | |
Spark('input.toggleButton').event('click', function(e) { | |
// When it is clicked toggle the li's | |
// If you wanted them to fade when toggling just pass a string to it containing 'fade' | |
Spark('li').toggle(); | |
}); |
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
// Loads my tweets over JSONP and passes them to the displayTweets function | |
Spark.jsonp('http://api.twitter.com/1/statuses/user_timeline.json', 'displayTweets', 'screen_name=SparkJavaScript&count=5'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment