想在网页的同一位置摆放四个层,按顺序循环显示(一个显示时那三个不可见)。不知有什么方法可以实现,特向各位高手们请教。
------解决方案--------------------
<script>
var current = 1;
function doit(){
var obj = document.getElementById( "pad_ " + current);
obj.style.display = "none ";
if(current == 4) current =0;
current++;
obj = document.getElementById( "pad_ " + current);
obj.style.display = "block ";
}
</script>
<input type= "button " onclick= "doit(); " value= "change ">
<div id= "pad_1 "> 1111 </div>
<div id= "pad_2 " style= "display:none; "> 2222 </div>
<div id= "pad_3 " style= "display:none; "> 3333 </div>
<div id= "pad_4 " style= "display:none; "> 4444 </div>