Skip to content

Instantly share code, notes, and snippets.

@arbales
Created Feb 29, 2012
Embed
What would you like to do?
<html>
<head>
<script src="/path/to/jquery.js" type="text/javascript"></script>
<script src="/path/to/jquery.kittenize.js" type="text/javascript"></script>
<script src="/path/to/sabrina.js" type="text/javascript"></script>
<title>Sabrina</title>
</head>
<body>
<h1>Hi!</h1>
<p class='kittens'>Kittens go here.</p>
<script type='text/javascript'>
// sometimes javascript wants to live in your html file. only sometimes.
// note how I don't need to check if the document is ready,
// since it's already loaded by the time we get here.
alert('kittens are coming...');
</script>
</body>
</html>
// pass a function to jquery that will execute when your page is ready.
$(function(){
// select <class='kittens'> elements and kittenize them.
$('.kittens').kittenize({
count: 5,
type: 'cheetah',
violent: true
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment