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: a guest on Dec 9th, 2013  |  syntax: None  |  size: 0.76 KB  |  views: 29  |  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. .animate({
  2.     height: 100,
  3.     width: 200,
  4.     marginTop: 50
  5. },duration)
  6.        
  7. .animate({left:0px})...
  8.        
  9. .animate({left:0px},200)
  10.        
  11. $("#block").animate({width: "70%",}, 1500 );
  12. Object with CSS properties ----^      ^--- Milliseconds
  13.        
  14. <!DOCTYPE html>
  15. <html>
  16. <head>
  17.   <style>
  18. div {
  19. background-color:#bca;
  20. width:100px;
  21. border:1px solid green;
  22. }
  23. </style>
  24.   <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  25. </head>
  26. <body>
  27.   <button id="go">&raquo; Run</button>
  28.  
  29. <div id="block">Hello!</div>
  30. <script>
  31.  
  32. /* Using multiple unit types within one animation. */
  33.  
  34. $("#go").click(function(){
  35.   $("#block").animate({
  36.     width: "70%",
  37.     opacity: 0.4,
  38.     marginLeft: "0.6in",
  39.     fontSize: "3em",
  40.     borderWidth: "10px"
  41.   }, 1500 );
  42. });
  43. </script>
  44.  
  45. </body>
  46. </html>