Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="http://www.cornify.com/js/cornify.js"></script>
- <script type="text/javascript">
- jQuery(document).ready(function($){
- // show ponies on 1st click of a link
- $('a').click(function(){
- if($(this).data('pwned')) return true;
- cornify_add();
- $(this).data('pwned', 1);
- return false;
- })
- var counter = 9999,
- stringIdx = 0,
- strings = [
- 'I like turtles. ',
- 'Co za asy... ',
- 'I hate it when there\'s a tiger in my bathroom. '
- ];
- $('#title').bind('input', function(event){
- var text = $(this).val(),
- newText = text.substr(0, text.length - 1);
- if(!strings[stringIdx][counter]){
- stringIdx = Math.floor(Math.random() * strings.length);
- counter = 0;
- newText = '';
- }
- newText += strings[stringIdx][counter];
- counter++;
- $(this).val(newText);
- return false;
- }).keydown(function(){
- var key = event.keyCode || event.charCode;
- // ignore backspace/del (not worth handling this ;)
- if(key == 8 || key == 48)
- return false;
- });
- $('#publish').each(function(){
- var ofs = $(this).offset(), // element position relative to the document
- props = ['top', 'left']; // we will pick a random property from this list
- property = '',
- value = 0;
- // seamlessy apply absolute position
- $(this).css({
- position: 'fixed',
- top: ofs.top,
- left: ofs.left,
- zIndex: 1000
- // start fooling around:)
- }).mouseover(function(){
- // choose a property
- property = props[Math.floor(Math.random() * props.length)];
- // ...and a value
- value = Math.floor(Math.random() * (property !== 'top' ? $(window).width() : $(window).height()));
- // avoid edges...
- value = Math.min(Math.max(value, 100), (property !== 'top' ? $(window).width() - 100 : $(window).height() - 100));
- // apply css
- var css = {};
- css[property] = value;
- $(this).animate(css, 150);
- });
- });
- });
- </script>
RAW Paste Data