<script>
function setTab(name,cursel,n){ //方法 setTab()及其三个参数
for(var i=1;i<=n;i++){ //循环变量 n是总共的切换数量
var menu=document.getElementById(name+i); //menu取出各个标题li的id值
var con=document.getElementById("con_"+name+"_"+i); //con是指内容里的id
con.style.display=i==cursel?"block":"none"; //判断对应关系,
}}
</script>
<div> <!--总层-->
<div>
<ul>
<li id="news1" class="hover" onmousemove="setTab('news',1,3)">医院报道</li>
<li id="news2" onmousemove="setTab('news',2,3)">最新动态</li>
<li id="news3" onmousemove="setTab('news',3,3)">党政工作</li>
</ul>
</div>
<div style="display: block;" id="con_news_1">111111111111111</div>
<div style="display: none;" id="con_news_2">222222222222222</div>
<div style="display: none;" id="con_news_3">333333333333333</div>
</div>