像CSDN论坛一样的导航栏实现

将下面代码另存成frame.html研究就行了:

 1<html>
 2<head>
 3<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
 4<title>无标题文档</title>
 5</head>
 6<style>   
 7<!--   
 8.ptr{color:red;cursor:hand;font-family:webdings}   
 9\-->   
10</style>
11<script>   
12function showandshade()   
13{   
14if(span1.innerText==3)   
15{   
16span1.innerText=4   
17document.all("td1").style.display="none"   
18}   
19else   
20{   
21span1.innerText=3   
22document.all("td1").style.display=""   
23}   
24}   
25</script>
26<body leftmargin="0" scroll="no" topmargin="0">
27<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
28<tr height="100%">
29<td height="100%" id="td1" style="display:" width="94">
30<iframe frameborder="0" scrolling="no" src="left.htm" width="70"></iframe>
31</td>
32<td bgcolor="#a4b6d7" onclick="showandshade()" style="font-size:7pt;width:5pt;cursor:default;color=:#ffffff" width="71">
33<span class="ptr" id="span1">3</span>
34</td>
35<td width="*">
36<iframe frameborder="0" height="100%" name="main" scrolling="yes" src="right.htm" width="100%">
37</iframe>
38</td>
39</tr>
40</table>
41</body>
42<script>   
43if(window.screen.width<'1024'){showandshade()}   
44</script>
45</html>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus