Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: kylecook80 on Jun 5th, 2012  |  syntax: JavaScript  |  size: 0.73 KB  |  views: 28  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var originalWidth, originalHeight;
  2.  
  3. var shrunk = 200;
  4. var expanded = 300;
  5.  
  6. function onHover() {
  7.         originalWidth = $(this).width();
  8.         originalHeight = $(this).height();
  9.        
  10.         moveLeft = Math.floor(originalWidth/4);
  11.         moveTop = Math.floor(originalHeight/4);
  12.  
  13.         $(this).stop(false, true).animate({
  14.                 left: -(moveLeft),
  15.                 top: -(moveTop),
  16.                 width: expanded,
  17.         },200);
  18. }
  19.  
  20. function offHover() {
  21.         $(this).stop(false, true).animate({
  22.                 left: 0,
  23.                 top: 0,
  24.                 width: shrunk,
  25.         },200);
  26. }
  27.  
  28. function initGallery() {
  29.         var imgArray = document.getElementsByTagName("img");
  30.         var galleryObj = document.getElementById("gallery");
  31.        
  32.         var columns = 3;
  33.         var rows = Math.ceil(imgArray.length/columns);
  34.        
  35.         var hozInc = 330;
  36.         var vertInc = 220;
  37. }