Posted By

juliusk on 12/17/10


Tagged

div css jquery animation


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

thisisrogerflanagan


Change on DIV to another Animation


 / Published in: jQuery
 

  1. HTML:
  2. <div id="container">
  3. <div id="div1"></div>
  4. <div id="div2"></div>
  5. </div>
  6.  
  7. CSS:
  8. #container {
  9. position:relative;
  10. width:400px;
  11. height:200px;
  12. }
  13. #container > div {
  14. position:absolute;
  15. top:0;
  16. left:0;
  17. min-width:400px;
  18. min-height:200px;
  19. width:400px;
  20. height:200px;
  21. }
  22. #div1 {
  23. background:red;
  24. }
  25. #div2 {
  26. background:blue;
  27. }
  28.  
  29. jQuery:
  30. $('#div1').hide();
  31. setInterval(function() {
  32. $('#container div').toggle(500);
  33. }, 2000)

Report this snippet  

You need to login to post a comment.