一、选项卡

 <style type="text/css">
	*{margin:0px auto; padding:0px;}
    #xuanxiangka{ width:434px; height:26px;text-align:center; line-height:26px; vertical-align:middle;}
	.xuanxiang{ width:434px; height:230px; display:none;}
	#a:hover{cursor:pointer;}
	#gongda{display:block; background-color:#309;}
    #meiti{background-color:#F03;}
	
    </style>
    </head>
    
    <body>
        <div >
        	<div >工大要闻</div>
            <div >媒体工大</div>
        </div>
        <div ></div>
        <div  ></div>
        
        
    <script type="text/javascript">
     function showa(d)
	 {
		 var div=document.getElementById(d);
		 var xuanxiang=document.getElementsByClassName("xuanxiang");
		 for(var i=0;i<xuanxiang.length;i++)
		 {
			 xuanxiang[i].style.display="none";
		}
		div.style.display="block";	 
	 }
    
    </script>
    </body>

  二、进度条

<style type="text/css">
*{ margin:0px auto; padding:0px}
#kuang{ width:200px; height:40px; border:2px solid #60F;}
#jindu{ height:40px; background-color:#F03; float:left}
</style>
</head>

<body>

<div >
	<div ></div>
</div>

<script type="text/javascript">

window.setTimeout("jindu()",30);

//调一下进度前进1%
function jindu()
{
	//获取进度div的宽度
	var div = document.getElementById("jindu");
	
	//获取到的是字符串"0px"
	var str = div.style.width;
	
	//处理字符串获取数字
	var cd = str.substr(0,str.length-2);
	
	//判断长度是否到最大值
	if(cd<200)
	{	
		//将长度转为整数加2
		var cd = parseInt(cd)+2;
		
		//让进度的DIV长度变为cd
		div.style.width = cd+"px";
		
		//调用自身
		window.setTimeout("jindu()",30);
	}
}


</script>

</body>

  

相关文章:

  • 2021-10-09
  • 2022-12-23
  • 2021-08-20
  • 2021-06-16
  • 2022-12-23
  • 2021-08-06
  • 2022-02-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
  • 2021-10-09
  • 2021-07-15
  • 2021-12-11
  • 2022-12-23
相关资源
相似解决方案