Created
April 8, 2011 04:31
-
-
Save elidupuis/909292 to your computer and use it in GitHub Desktop.
Usage examples of the jquery.purrrify plugin
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
<script> | |
$(function(){ | |
// this will trigger purrrify when $('#myTrigger') is clicked: | |
$.purrrify({ | |
trigger: { selector: '#myTrigger', event: 'click' } | |
}); | |
}); | |
</script> |
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
<script> | |
$(function(){ | |
// this will trigger purrrify only if the konami code is entered (up,up,down,down,left,right,left,right,b,a): | |
$.purrrify( { trigger: 'konami' } ); | |
}); | |
</script> |
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
<script> | |
$(function(){ | |
// this will purrrify your site on page load (after all scripts and images have loaded): | |
$.purrrify( { trigger: 'onload' } ); | |
}); | |
</script> |
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
<script> | |
$(function(){ | |
// this will trigger purrrify when $('#myTrigger') is clicked. | |
// all <img/> elements inside the <body> element will be targeted. | |
// color kitten images will be used, not grayscale. | |
// the kittens will fade in once loaded. uses $('img').load() function. | |
// these are all the options of jquery.purrrify, with the default values shown. | |
$.purrrify({ | |
context: 'body', | |
selector: 'img', // must return <img/> elements! | |
grayscale: false, | |
fadeIn: true, | |
trigger: { selector: '#myTrigger', event: 'click' } | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment