<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>wzsts</title> <style> .Menu{position:relative;background-color:#4295BD;height:60px;} .menuDiv ul li{float:left; padding:21px 10px; margin-right:60px;color:white;} .menuDiv ul li:hover{ background-color:#0066CC; cursor:pointer} </style> </head> <body> <center> <div class="Menu"> <div class="menuDiv"> <ul> <li onclick="getPage(‘1‘)" id="menu1">W3C</li> <li onclick="getPage(‘2‘)" id="menu2">anycodes</li> <li onclick="getPage(‘3‘)" id="menu3">tool</li> <li onclick="getPage(‘4‘)" id="menu4">GitHub</li> <li onclick="getPage(‘5‘)" id="menu5">csdn</li> <li onclick="getPage(‘6‘)" id="menu6">csdn</li> <li onclick="getPage(‘7‘)" id="menu7">csdn</li> <li onclick="getPage(‘8‘)" id="menu8">cs1dn</li> <li onclick="getPage(‘9‘)" id="menu9">cs2dn</li> <li onclick="getPage(‘10‘)" id="menu10">csdn</li> </ul> </div> </div> <iframe src=\‘#\‘" /iframe> </div> </center> </body> <script> function getPage(n){ switch(n){ case ‘1‘:document.getElementById("VideoIframe").src="http://www.w3school.com.cn/"; break; case ‘2‘:document.getElementById("VideoIframe").src="http://anycodes.cn/zh/"; break; case ‘3‘:document.getElementById("VideoIframe").src="http://tool.lu/coderunner/"; break; case ‘4‘:document.getElementById("VideoIframe").src="http://github.com/HonestFox/"; break; case ‘5‘:document.getElementById("VideoIframe").src="http://blog.csdn.net/21aspnet/"; break; case ‘6‘:document.getElementById("VideoIframe").src="http://blog.csdn.net/phphot/"; break; case ‘7‘:document.getElementById("VideoIframe").src="http://github.com/zhedahht/"; break; case ‘8‘:document.getElementById("VideoIframe").src="http://www.acmerblog.com/"; break; case ‘9‘:document.getElementById("VideoIframe").src="http://github.com/HonestFox/"; break; case ‘10‘:document.getElementById("VideoIframe").src="http://blog.csdn.net/21aspnet/"; break; } changeBgcolor(n); } function changeBgcolor(n) { for(var i=1;i<=10;i++) { document.getElementById("menu"+i).style.backgroundColor="#4295BD"; } document.getElementById("menu"+n).style.backgroundColor="#0066CC"; } </script> </html>
时间: 2024-10-13 07:10:22