/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
HTML: <div id="container"> <div id="div1"></div> <div id="div2"></div> </div> CSS: #container { position:relative; width:400px; height:200px; } #container > div { position:absolute; top:0; left:0; min-width:400px; min-height:200px; width:400px; height:200px; } #div1 { background:red; } #div2 { background:blue; } jQuery: $('#div1').hide(); setInterval(function() { $('#container div').toggle(500); }, 2000)