Skip to content

Instantly share code, notes, and snippets.

@elidupuis
Created April 8, 2011 04:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elidupuis/909292 to your computer and use it in GitHub Desktop.
Save elidupuis/909292 to your computer and use it in GitHub Desktop.
Usage examples of the jquery.purrrify plugin
<script>
$(function(){
// this will trigger purrrify when $('#myTrigger') is clicked:
$.purrrify({
trigger: { selector: '#myTrigger', event: 'click' }
});
});
</script>
<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>
<script>
$(function(){
// this will purrrify your site on page load (after all scripts and images have loaded):
$.purrrify( { trigger: 'onload' } );
});
</script>
<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