Advertisement
Guest User

two moving divs example

a guest
Mar 21st, 2010
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.83 KB | None | 0 0
  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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement