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

two moving divs example

By: a guest on Mar 21st, 2010  |  syntax: HTML  |  size: 0.83 KB  |  views: 321  |  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. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2.         "http://www.w3.org/TR/html4/strict.dtd">
  3. <html>
  4. <head>
  5.         <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  6.         <title>jquery1</title>
  7.         <style type="text/css" media="screen">
  8.                 #something {
  9.                
  10.                 width: 100px;
  11.                 height: 50px;
  12.                 background-color: red;
  13.                 color: white;
  14.                 border: 4px solid black;
  15.                 margin: 100px 0 0 80px;
  16.                
  17.                 }
  18.         </style>
  19. </head>
  20. <body>
  21.         <div id="something"><p>this is some text</p></div>
  22.         <div id="something"><p>this is some more text</p></div>
  23.         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
  24.         <script type="text/javascript">
  25.                 $('#something').animate({'margin-left': '400px'},1000);
  26.                 $('#something').animate({'margin-top': '300px'},1000);
  27.         </script>
  28. </body>
  29. </html>