[网网秀]Javascript代码碎片四(导航{tx}) - 无边尘事皆忘却,只有雪花满 ...
[网网秀]Javascript代码碎片四(导航{tx}) [原创 2010-06-06 14:24:38]   
 

4-1  折叠展开收缩效果的栏目分类导航

 

<style type="text/css">

td {font-size: 12px;}

</style>

</head>

 

<body>

 

<table width="200" height="250" border="0" align="center" cellpadding="0" cellspacing="0">

      <tr>

           <td height="38">

           <img height="38" src="images/leftlist_head.jpg" width="200" /></td>

      </tr>

      <tr>

           <td align="center" valign="top" background="images/leftlist_bg.jpg">

           <script language="javascript" id="clientEventHandlersJS">

<!--

var number=8;

 

function LMYC() {

var lbmc;

//var treePic;

    for (i=1;i<=number;i++) {

        lbmc = eval('LM' + i);

        //treePic = eval('treePic'+i);

        //treePic.src = 'images/file.gif';

        lbmc.style.display = 'none';

    }

}

 

function ShowFLT(i) {

    lbmc = eval('LM' + i);

    //treePic = eval('treePic' + i)

    if (lbmc.style.display == 'none') {

        LMYC();

        //treePic.src = 'images/nofile.gif';

        lbmc.style.display = '';

    }

    else {

        //treePic.src = 'images/file.gif';

        lbmc.style.display = 'none';

    }

}

//-->

      </script>

           <table cellspacing="0" cellpadding="0" width="88%" border="0">

                 <tr>

                      <td style="PADDING-LEFT: 20px" background height="23">

                      <img height="9" src="images/bit05.gif" width="8" align="absMiddle">

                      <a onclick="javascript:ShowFLT(1)" href="javascript:void(null)">

                      文管产品</a> </td>

                 </tr>

                 <tr id="LM1" style="DISPLAY: none">

                      <td>

                      <table cellspacing="0" cellpadding="0" width="{bfb}" border="0">

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="文件夹" href="http://www.jscode.cn" target="_parent">

                                  文件夹</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="资料册" href="http://www.jscode.cn" target="_parent">

                                  资料册</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="档案盒" href="http://www.jscode.cn" target="_parent">

                                  档案盒</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="文件盒" href="http://www.jscode.cn" target="_parent">

                                  文件盒</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="文件柜" href="http://www.jscode.cn" target="_parent">

                                  文件柜</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="公文包" href="http://www.jscode.cn" target="_parent">

                                  公文包</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                      </table>

                      </td>

                 </tr>

                 <tr>

                      <td style="PADDING-LEFT: 20px" background height="23">

                      <img height="9" src="images/bit05.gif" width="8" align="absMiddle">

                      <a onclick="javascript:ShowFLT(2)" href="javascript:void(null)">

                      桌面文具</a> </td>

                 </tr>

                 <tr id="LM2" style="DISPLAY: none">

                      <td>

                      <table cellspacing="0" cellpadding="0" width="{bfb}" border="0">

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="削笔机" href="http://www.jscode.cn" target="_parent">

                                  削笔机</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="订书机" href="http://www.jscode.cn" target="_parent">

                                  订书机</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                      </table>

                      </td>

                 </tr>

                 <tr>

                      <td style="PADDING-LEFT: 20px" background height="23">

                      <img height="9" src="images/bit05.gif" width="8" align="absMiddle">

                      <a onclick="javascript:ShowFLT(3)" href="javascript:void(null)">

                      商用机器</a> </td>

                 </tr>

                 <tr id="LM3" style="DISPLAY: none">

                      <td>

                      <table cellspacing="0" cellpadding="0" width="{bfb}" border="0">

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="碎纸机" href="http://www.jscode.cn" target="_parent">

                                  碎纸机</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="切纸刀" href="http://www.jscode.cn" target="_parent">

                                  切纸刀</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                      </table>

                      </td>

                 </tr>

                 <tr>

                      <td style="PADDING-LEFT: 20px" background height="23">

                      <img height="9" src="images/bit05.gif" width="8" align="absMiddle">

                      <a onclick="javascript:ShowFLT(4)" href="javascript:void(null)">

                      书写工具</a> </td>

                 </tr>

                 <tr id="LM4">

                      <td>

                      <table cellspacing="0" cellpadding="0" width="{bfb}" border="0">

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="中性笔" href="http://www.jscode.cn" target="_parent">

                                  中性笔</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="圆珠笔" href="http://www.jscode.cn" target="_parent">

                                  圆珠笔</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                 <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="记号笔" href="http://www.jscode.cn" target="_parent">

                                  记号笔</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="白板笔" href="http://www.jscode.cn" target="_parent">

                                  白板笔</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                      </table>

                      </td>

                 </tr>

                 <tr>

                      <td style="PADDING-LEFT: 20px" background height="23">

                      <img height="9" src="images/bit05.gif" width="8" align="absMiddle">

                      <a onclick="javascript:ShowFLT(5)" href="javascript:void(null)">

                      纸制品</a> </td>

                 </tr>

                 <tr id="LM5" style="DISPLAY: none">

                      <td>

                      <table cellspacing="0" cellpadding="0" width="{bfb}" border="0">

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="传真纸" href="http://jscode.cn" target="_parent">

                                  传真纸</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="复印纸" href="http://www.jscode.cn" target="_parent">

                                  复印纸</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="复写纸" href="http://www.jscode.cn" target="_parent">

                                  复写纸</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="便条纸" href="http://www.jscode.cn" target="_parent">

                                  便条纸</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="百事贴" href="http://www.jscode.cn" target="_parent">

                                  百事贴</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="皮面笔记本" href="http://www.jscode.cn" target="_parent">

                                  皮面笔记本</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                      </table>

                      </td>

                 </tr>

                 <tr>

                      <td style="PADDING-LEFT: 20px" background height="23">

                      <img height="9" src="images/bit05.gif" width="8" align="absMiddle">

                      <a onclick="javascript:ShowFLT(6)" href="javascript:void(null)">

                      办公电子</a> </td>

                 </tr>

                 <tr id="LM6" style="DISPLAY: none">

                      <td>

                      <table cellspacing="0" cellpadding="0" width="{bfb}" border="0">

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="计算器" href="http://www.jscode.cn" target="_parent">

                                  计算器</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                      </table>

                      </td>

                 </tr>

                 <tr>

                      <td style="PADDING-LEFT: 20px" background height="23">

                      <img height="9" src="images/bit05.gif" width="8" align="absMiddle">

                      <a onclick="javascript:ShowFLT(7)" href="javascript:void(null)">

                      IT周边产品</a> </td>

                 </tr>

                 <tr id="LM7" style="DISPLAY: none">

                      <td>

                      <table cellspacing="0" cellpadding="0" width="{bfb}" border="0">

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="阅读架" href="http://www.jscode.cn" target="_parent">

                                 阅读架</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="CD保护" href="http://www.jscode.cn" target="_parent">

                                  CD保护</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="光盘盒" href="http://www.jscode.cn" target="_parent">

                                  光盘盒</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                      </table>

                      </td>

                 </tr>

                 <tr>

                      <td style="PADDING-LEFT: 20px" background height="23">

                      <img height="9" src="images/bit05.gif" width="8" align="absMiddle">

                      <a onclick="javascript:ShowFLT(8)" href="javascript:void(null)">

                      办公生活用品</a> </td>

                 </tr>

                 <tr id="LM8" style="DISPLAY: none">

                      <td>

                      <table cellspacing="0" cellpadding="0" width="{bfb}" border="0">

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="清洁桶" href="http://www.jscode.cn" target="_parent">

                                  清洁桶</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="白板" href="http://www.jscode.cn" target="_parent">

                                  白板</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="网状文具" href="http://www.jscode.cn" target="_parent">

                                  网状文具</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="封箱器" href="http://www.jscode.cn" target="_parent">

                                  封箱器</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                            <tr>

                                  <td style="PADDING-LEFT: 40px" height="23">

                                  <img height="7" src="images/bit06.gif" width="8" align="absMiddle">

                                  <a title="购物袋" href="http://www.jscode.cn" target="_parent">

                                  购物袋</a> </td>

                            </tr>

                            <tr>

                                  <td background height="3"></td>

                            </tr>

                      </table>

                      </td>

                 </tr>

           </table>

           </td>

      </tr>

      <tr>

           <td height="17">

           <img height="17" src="images/leftlist_bottom.jpg" width="200" /></td>

      </tr>

</table>

 

 

4-2  腾讯QQ网页在线客服,隐藏在网页一侧的隐现效果二

 

<!-- 左隐藏菜单开始 -->

<script language="JavaScript1.2">

 

function move(x, y) {

if (document.all) {

object1.style.pixelLeft += x;

object1.style.pixelTop  += y;}

else

if (document.layers) {

document.object1.left += x;

document.object1.top  += y;

}};

 

function position() {

document.object1.left += -200;

document.object1.top  += 0;

document.object1.visibility = "show"

};

 

function makeStatic() {

if (document.all) {object1.style.pixelTop=document.body.scrollTop+100}

else {eval('document.object1.top=eval(window.pageYOffset+20)');}

setTimeout("makeStatic()",0);}

 

</script>

<!-- 左隐藏菜单结束 -->

<!-- 左隐藏菜单BIG -->

<layer class="NS" onmouseover="move(580,0)" onmouseout="move(-580, 0)" top="20" visibility="hide" name="object1" left="0">

      <script language="JavaScript1.2">

if (document.all)

document.write('<DIV ID="object1" style="Position : Absolute ;Left : -125px ;Top : 20px ;Width : 0px ;Z-Index : 20">')

</script>

<table onmouseover="move(120,0)" onmouseout="move(-120, 0)" cellspacing="1" cellpadding="2" border="0">

           <tr>

                 <td><table cellspacing="0" cellpadding="0" width="118" align="center" border="0">

                      <tr>

                            <td>&nbsp;</td>

                      </tr>

                      <tr>

                            <td>

                            <table cellspacing="0" cellpadding="0" width="118" align="left" border="0">

                                  <tr>

                                       <td background="images/servicepic_02.jpg">

                                       <img height="25" alt="" src="images/servicepic_02.jpg" width="14" border="0" name="servicepic_02"></td>

                                       <td align="middle" width="89" bgcolor="#f8f6f7" height="25">

                                       <a target="blank" href="tencent://message/?uin=615050000&Site=网页{tx}观止&Menu=yes"></a></td>

                                       <td background="images/servicepic_04.jpg">&nbsp;</td>

                              </tr>

                            </table>

                            </td>

                      </tr>

                      <tr>

                            <td>&nbsp;</td>

                   </tr>

                      <tr>

                            <td>

                            <table cellspacing="0" cellpadding="0" width="118" align="left" border="0">

                                  <tr>

                                       <td background="images/servicepic_06.jpg">&nbsp;</td>

                                       <td align="middle" width="89" bgcolor="#f8f6f7" height="24">&nbsp;</td>

                                    <td background="images/servicepic_08.jpg">&nbsp;</td>

                              </tr>

                                  <tr>

                                       <td background="images/servicepic_06.jpg"> </td>

                                       <td align="middle" bgcolor="#f8f6f7" height="35">&nbsp;</td>

                                    <td background="images/servicepic_08.jpg"> </td>

                                  </tr>

                            </table>

                            </td>

                      </tr>

                      <tr>

                            <td>&nbsp;</td>

                      </tr>

                 </table>

                 </td>

                 <td valign="top" align="middle" width="12" rowspan="100">&nbsp;</td>

           </tr>

           <script language="JavaScript1.2">

<!--

if (document.all||document.layers)

makeStatic();

 

if (document.layers) {

window.onload=position;

}

 

var sitems=new Array();

var sitemlinks=new Array();

 

function hl(n) {

n.className='hl'}

function n(h) {

h.className='n'}

//--></script>

      </table>

      <script language="JavaScript1.2">

if (document.all)

document.write('<\/DIV>')

</script>

</layer>

<a target="blank" href="tencent://message/?uin=615050000&Site=网页{tx}观止&Menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=1:615050000:10" alt="点击这里给我发消息"></a>

<!-- 左隐藏菜单END -->

</body>

 

</html>

 

 

4-3 左右交叉合并导航效果

 

<script>

 

<!-- Beginning of JavaScript -

 

// Edit your messages. You can add as many messages a you like.

 

var message = new Array()

 

message[0]="欢迎光临国内{zd0}的新闻站点---新浪网!"

 

message[1]="欢迎光临国内{zd0}的综合性站点---网易!"

 

message[2]="欢迎光临国内{zd0}的搜索引擎站点---搜狐!"

 

message[3]="欢迎光临国内{zd0}的游戏站点---第九城市!"

 

 

 

// The links of your messages. Be sure that you configure as many links as messages.

 

// If don't want to link your messages write '#' instead of an URL (see last sample).

 

var messageurl = new Array()

 

messageurl[0]="http://../www.sina.com.cn/default.htm"

 

messageurl[1]="http://../www.163.com/default.htm"

 

messageurl[2]="http://../www.sohu.com/default.htm"

 

messageurl[3]="http://../www.the9.com/default.htm"

 

 

 

 

 

var messagetarget=new Array()

 

messagetarget[0]="_blank"

 

messagetarget[1]="_blank"

 

messagetarget[2]="_blank"

 

messagetarget[3]="_blank"

 

// The width of your textbox (pixels).

 

// Be sure that 'textwidth' is slightly bigger than the 'width' configured inside the stylesheet

 

var textwidth=260

 

 

 

// The height of your textbox (pixels)

 

// Be sure that 'textheight' is slightly bigger than the 'height' configured inside the stylesheet

 

var textheight=75

 

 

 

// Final horizontal position of the textbox: distance to the left margin of the window (pixels)

 

// IMPORTANT:

 

// if you want to center the textbox in the middle of the browser-window then write -1.

 

// If you want to place the textbox on an absolute position

 

// then write the number (for instance 223).

 

var x_finalpos=-1

 

 

 

// Final vertical position of the textbox: distance to the top margin of the window

 

var y_finalpos=20

 

 

 

// Total number of textslices

 

var textslices=10

 

 

 

// Standstill of textbox (seconds)

 

var pausetext=5

 

 

 

// Speed of horizontal gliding

 

var step=10

 

var pause=40

 

 

 

// Do not edit the variables below this line

 

var x_rightspans=0

 

var x_leftspans=0

 

var marginright

 

var marginleft

 

var height_slice=Math.floor(textheight/textslices)

 

var cliptop=0

 

var clipbottom=cliptop+height_slice

 

var clipleft=0

 

var clipright=textwidth

 

var spannummer=0

 

var spannrbefore=0

 

var i_message=0

 

pausetext=pausetext*1000

 

 

 

function initiate() {

 

if (document.all) {

 

if (x_finalpos==-1) {

 

x_finalpos=Math.floor(document.body.clientWidth/2)-Math.floor(textwidth/2)

 

}

 

changemessage()

 

}

 

}

 

 

 

function changemessage() {

 

for (i=0;i<=textslices-1;i++) {

 

var thisspan=eval("span"+i)

 

thisspan.innerHTML="<a href='"+messageurl[i_message]+"' target='blank'>"+message[i_message]+"</a>"

 

}

 

gostartposition()

 

}

 

 

 

function gostartposition() {

 

for (i=0;i<=textslices-1;i+=2) {

 

var thisspan=eval("document.all.span"+i+".style")

 

thisspan.posLeft=marginright

 

}

 

for (i=1;i<=textslices-1;i+=2) {

 

var thisspan=eval("document.all.span"+i+".style")

 

thisspan.posLeft=marginleft

 

}

 

moveslices_IE()

 

}

 

 

 

 

 

function moveslices_IE() {

 

if (x_rightspans==0 || x_leftspans==0) {

 

if (x_rightspans==0) {

 

for (i=0;i<=textslices-1;i+=2) {

 

var thisspan=eval("document.all.span"+i+".style")

 

thisspan.posLeft-=step

 

}

 

if (thisspan.posLeft<=x_finalpos) {

 

x_rightspans=1

 

for (i=0;i<=textslices-1;i+=2) {

 

var thisspan=eval("document.all.span"+i+".style")

 

thisspan.posLeft=x_finalpos

 

}

 

}

 

}

 

if (x_leftspans==0) {

 

for (i=1;i<=textslices-1;i+=2) {

 

var thisspan=eval("document.all.span"+i+".style")

 

thisspan.posLeft+=step

 

}

 

if (thisspan.posLeft>=x_finalpos) {

 

x_leftspans=1

 

for (i=1;i<=textslices-1;i+=2) {

 

var thisspan=eval("document.all.span"+i+".style")

 

thisspan.posLeft=x_finalpos

 

}

 

}

 

}

 

var timer=setTimeout("moveslices_IE()",pause)

 

}

 

else {

 

clearTimeout(timer)

 

x_rightspans=0

 

x_leftspans=0

 

i_message++

 

if (i_message > message.length-1) {

 

i_message=0

 

}

 

var timer=setTimeout("changemessage()",pausetext)

 

}

 

}

 

 

 

// - End of JavaScript - -->

 

</script>

 

<style>

 

A {

 

color : red;

 

text-decoration : none

 

}

 

A:hover {

 

color : white;

 

text-decoration : none

 

}

 

.textbox {

 

font-size : 18;

 

font-family : Verdana;

 

font-style : normal;

 

color : red;

 

border-width : 4;

 

text-align : center;

 

background-color : blue;

 

border-style : solid;

 

padding : 5;

 

height : 65;

 

width : 250;

 

overflow : clip;

 

font-weight : bold;

 

}

 

</style>

 

<script>

 

<!-- Beginning of JavaScript -

 

// Do not edit this script-block

 

if (document.all) {

 

for (i=0;i<=textslices-1;i+=2) {

 

marginright=document.body.clientWidth+50

 

document.write("<span class='textbox' id='span"+i+"' style='position:absolute;visibility:visible; left:"+marginright+"px;top:"+y_finalpos+"px;clip:rect("+cliptop+"px "+clipright+"px "+clipbottom+"px "+clipleft+"px)'>")

 

document.write("</span>")

 

cliptop+=2*height_slice

 

clipbottom+=2*height_slice

 

}

 

cliptop=height_slice

 

clipbottom=2*height_slice

 

for (i=1;i<=textslices-1;i+=2) {

 

marginleft=-textwidth-50

 

document.write("<span class='textbox' id='span"+i+"' style='position:absolute;visibility:visible; left:"+marginleft+"px;top:"+y_finalpos+"px;clip:rect("+cliptop+"px "+clipright+"px "+clipbottom+"px "+clipleft+"px)'>")

 

document.write("</span>")

 

cliptop+=2*height_slice

 

clipbottom+=2*height_slice

 

}

 

}

 

// - End of JavaScript - -->

 

</script>

 

<div style="position: absolute; top: -25; left: 9; width: 717; height: 19">

 

</div></body>

 

 

 

4-4类似按钮效果的网站导航CSS代码(html)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">

<head>

<title>Lists as navigation</title>

content="text/html; charset=utf-8" />

<style type="text/css">

#navigation {

font-size:90%

}

#navigation ul {

list-style: none;

margin: 0;

padding: 0;

padding-top: 1em;

}

#navigation li {

display: inline;

}

#navigation a:link, #navigation a:visited {

margin-right: 0.2em;

padding: 0.2em 0.6em 0.2em 0.6em;

color: #A62020;

background-color: #FCE6EA;

text-decoration: none;

border-top: 1px solid #FFFFFF;

border-left: 1px solid #FFFFFF;

border-bottom: 1px solid #717171;

border-right: 1px solid #717171;

}

#navigation a:hover {

border-top: 1px solid #717171;

border-left: 1px solid #717171;

border-bottom: 1px solid #FFFFFF;

border-right: 1px solid #FFFFFF;

}

</style>

</head>

<body>

<div id="navigation">

<ul>

<li><a href="#">Recipes</a></li>

<li><a href="#">Contact Us</a></li>

<li><a href="#">Articles</a></li>

<li><a href="#">Buy Online</a></li>

</ul>

</div>

</body>

</html>

 

4-5网页教学网制作的网页下拉菜单(html

 

<!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>

content="text/html; charset=gb2312" />

<title>二级菜单</title>

<style type="text/css">

/* 整体设置*/

#menu {

margin:0;

padding:0;

width:610px;

list-style-type:none;

font:14px Arial;

}

#menu li {

float:left;

padding:0;

margin:0 1px 0 0;

width:150px;

}

/* 设置菜单项*/

#menu li dl {

width:150px;/*ie6*/

margin: 0;

padding: 0 0 10px 0;

background: #cb6 url(images/bottom.gif) no-repeat bottom left;

}

#menu li dt a,#menu li dd a{ display:block;}

/* 设置菜单项的dt */

#menu li dt {

margin:0;

padding: 5px;

text-align:center;

border-bottom:1px solid #b00;

background:

}

#menu li dt.orange { background:#fa5 url(images/top.gif) no-repeat top left;}

#menu li dt.yellow { background:#ee5 url(images/top.gif) no-repeat top left;}

#menu li dt.green  { background:#5e5 url(images/top.gif) no-repeat top left;}

#menu li dt.blue   { background:#5cf url(images/top.gif) no-repeat top left;}

#menu li dt a ,#menu li dt a:visited {

display:block;

color:#333;

text-decoration:none;

}

/* 设置菜单项的dd */

#menu li dd {

margin:0;

padding:0;

color: #fff;

background: #47a;

}

#menu li dd.last {

border-bottom:1px solid #b00;

}

#menu li dd a, #menu li dd a:visited {

display:block;

color:#fff;

text-decoration:none;

padding:4px 5px 4px 20px;

background: #47a url(images/arrow.gif) no-repeat 10px 10px;

height:1em;

}

/*关闭子菜单*/

#menu li dd { display:none;}

/* 设置鼠标响应 */

#menu li:hover dd , #menu li a:hover dd { display:block;}

#menu li:hover, #menu li a:hover { border:0;}/*ie6*/

#menu li dd a:hover {

background: #147;

color:#9cf;

}

/*针对ie6的设置*/

#menu table { border-collapse:collapse;

padding:0;

margin:-1px;

font-size:1em;

}

</style>

</head>

<body>

<ul id="menu">

<li>

<!--[if lte IE 6]><a href="#nogo"><table><tr><td><![endif]-->

<dl>

<dt class="orange"><a href="#">Artech Studio</a></dt>

<dd><a href="#">Web Dev</a></dd>

<dd><a href="#">Web Design</a></dd>

<dd><a href="#">Books</a></dd>

<dd class="last"><a href="#">Contact Us</a></dd>

</dl>

<!--[if lte IE 6]></td></tr></table></a><![endif]-->

</li>

<li>

<!--[if lte IE 6]><a href="#nogo"><table><tr><td><![endif]-->

<dl>

<dt class="yellow"><a href="#">Artech Store</a></dt>

<dd><a href="#">Books</a></dd>

<dd><a href="#">DVDs</a></dd>

<dd><a href="#">Movies</a></dd>

<dd class="last"><a href="#">Service</a></dd>

</dl>

<!--[if lte IE 6]></td></tr></table></a><![endif]-->

</li>

<li>

<!--[if lte IE 6]><a href="#nogo"><table><tr><td><![endif]-->

<dl>

<dt class="green"><a href="#">Artech Achi</a></dt>

<dd><a href="#">Landscape</a></dd>

<dd><a href="#">Plan</a></dd>

<dd><a href="#">Design</a></dd>

<dd class="last"><a href="#">Maps</a></dd>

</dl>

<!--[if lte IE 6]></td></tr></table></a><![endif]-->

</li>

<li>

<!--[if lte IE 6]><a href="#nogo"><table><tr><td><![endif]-->

<dl>

<dt class="blue"><a href="#">Artech Science</a></dt>

<dd><a href="#">Physics</a></dd>

<dd><a href="#">Maths</a></dd>

<dd><a href="#">Chemistry</a></dd>

<dd class="last"><a href="#">Courses</a></dd>

</dl>

<!--[if lte IE 6]></td></tr></table></a><![endif]-->

</li>

</ul>

</body>

</html>

 

4-6网页教学网制作的网页下拉菜单(html

 

<!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>

content="text/html; charset=utf-8" />

<title>CSS下拉菜单</title>

<style type="text/css">

/* common styling */

.menu {font-family: verdana, arial, sans-serif; width:735px; position:relative; font-size:11px; margin:50px auto;}

.menu ul li a, .menu ul li a:visited {display:block; text-decoration:none; width:94px; height:25px; text-align:left; color:#000; padding-left:10px; border:1px solid #fff; border-width:0 1px 1px 0; background:#c9c9a7; line-height:25px; font-size:11px;}

.menu ul {padding:0; margin:0;list-style-type: none; }

.menu ul li {float:left; position:relative;}

.menu ul li ul {display: none;}

/* specific to non IE browsers */

.menu ul li:hover a {color:#000; background:#e9e9c7;}

.menu ul li:hover ul {display:block; position:absolute; bottom:26px; left:0;}

.menu ul li:hover ul li a.hide {background:#a7c9c9; color:#000;}

.menu ul li:hover ul li {display:block; background:#fff; color:#000;width:199px; clear:both;}

.menu ul li:hover ul li:hover a.hide {background:#dfc184; color:#000;}

.menu ul li:hover ul li ul {display: none;}

.menu ul li:hover ul li a {display:block; background:#c9a7c9; color:#000; width:{bfb}; padding-left:10px;}

.menu ul li:hover ul li a:hover {background:#dfc184; color:#000;}

.menu ul li:hover ul li:hover ul {display:block; position:absolute; left:210px; bottom:0;}

.menu ul li:hover ul li:hover ul li a {background:#dfc184; color:#000;}

.menu ul li:hover ul li:hover ul li a:hover {background:#c9c9a7; color:#000;}

.menu ul li:hover ul.left {left:-105px;}

.menu ul li:hover ul li:hover ul.left {left:-210px; width:209px;}

</style>

<!--[if lte IE 6]>

<style type="text/css">

table {border-collapse:collapse; margin:0; padding:0;}

.menu ul li a.hide, .menu ul li a:visited.hide {display:none;}

.menu ul li a:hover ul li a.hide {display:none;}

.menu ul li a:hover {color:#000; background:#e9e9c7;}

.menu ul li a:hover ul {display:block; position:absolute; bottom:26px; left:0;}

.menu ul li a:hover ul li {display:block; background:#fff; color:#000; width:199px;}

.menu ul li a:hover ul li a.sub {background:#a7c9c9; color:#000;}

.menu ul li a:hover ul li a {display:block; background:#c9a7c9; color:#000; width:{bfb}; padding-left:10px;}

.menu ul li a:hover ul li a ul {visibility:hidden;}

.menu ul li a:hover ul li a:hover {background:#dfc184; color:#000;}

.menu ul li a:hover ul li a:hover ul {visibility:visible; position:absolute; left:210px; bottom:0;}

.menu ul li a:hover ul li a:hover ul li a {background:#dfc184; color:#000;}

.menu ul li a:hover ul li a:hover ul li a:hover {background:#c9c9a7; color:#000;}

.menu ul li a:hover ul.left {left:-105px;}

.menu ul li a:hover ul li a:hover ul.left {left:-210px;}

</style>

<![endif]-->

</head>

<body>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<div class="menu">

<ul>

<li><a class="hide" href="../menu/index.html">DEMOS</a>

<!--[if lte IE 6]>

<a href="../menu/index.html">DEMOS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../menu/zero_dollars.html" title="The zero dollar ads page">zero dollars</a></li>

<li><a href="../menu/embed.html" title="Wrapping text around images">wrapping text</a></li>

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a class="hide" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK &gt;</a>

<!--[if lte IE 6]>

<a class="sub" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK &gt;

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a href="../menu/shadow_boxing.html" title="Multi-position drop shadow">shadow boxing</a></li>

<li><a href="../menu/old_master.html" title="Image Map for detailed information">image map</a></li>

<li><a href="../menu/bodies.html" title="fun with background images">fun backgrounds</a></li>

<li><a href="../menu/fade_scroll.html" title="fade-out scrolling">fade scrolling</a></li>

<li><a href="../menu/em_images.html" title="em size images compared">em sized images</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="index.html">MENUS</a>

<!--[if lte IE 6]>

<a href="index.html">MENUS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>

<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>

<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>

<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>

<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>

<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>

<li><a href="circles.html" title="circular links">circular links</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../layouts/index.html">LAYOUTS</a>

<!--[if lte IE 6]>

<a href="../layouts/index.html">LAYOUTS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../layouts/bodyfix.html" title="Cross browser fixed layout">Fixed 1</a></li>

<li><a href="../layouts/body2.html" title="Cross browser fixed layout">Fixed 2</a></li>

<li><a href="../layouts/body4.html" title="Cross browser fixed layout">Fixed 3</a></li>

<li><a href="../layouts/body5.html" title="Cross browser fixed layout">Fixed 4</a></li>

<li><a href="../layouts/minimum.html" title="A simple minimum width layout">minimum width</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../boxes/index.html">BOXES</a>

<!--[if lte IE 6]>

<a href="../boxes/index.html">BOXES

<table><tr><td>

<![endif]-->

<ul>

<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>

<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>

<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>

<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>

<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>

<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>

<li><a href="circles.html" title="circular links">circular links</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../mozilla/index.html">MOZILLA</a>

<!--[if lte IE 6]>

<a href="../mozilla/index.html">MOZILLA

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../mozilla/dropdown.html" title="A drop down menu">drop down menu</a></li>

<li><a href="../mozilla/cascade.html" title="A cascading menu">cascading menu</a></li>

<li><a href="../mozilla/content.html" title="Using content:">content:</a></li>

<li><a href="../mozilla/moxbox.html" title=":hover applied to a div">mozzie box</a></li>

<li><a href="../mozilla/rainbow.html" title="I can build a rainbow">rainbow box</a></li>

<li><a href="../mozilla/snooker.html" title="Snooker cue">snooker cue</a></li>

<li><a href="../mozilla/target.html" title="Target Practise">target practise</a></li>

<li><a href="../mozilla/splittext.html" title="Two tone headings">two tone headings</a></li>

<li><a href="../mozilla/shadow_text.html" title="Shadow text">shadow text</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../ie/index.html">EXPLORER</a>

<!--[if lte IE 6]>

<a href="../ie/index.html">EXPLORER

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../ie/exampleone.html" title="Example one">example one</a></li>

<li><a href="../ie/weft.html" title="Weft fonts">weft fonts</a></li>

<li><a href="../ie/exampletwo.html" title="Vertical align">vertical align</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../opacity/index.html">OPACITY</a>

<!--[if lte IE 6]>

<a href="../opacity/index.html">OPACITY

<table><tr><td>

<![endif]-->

<ul class="left">

<li><a class="hide" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">&lt; HOVER/CLICK</a>

<!--[if lte IE 6]>

<a class="sub" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">&lt; HOVER/CLICK

<table><tr><td>

<![endif]-->

<ul class="left">

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a href="../opacity/colours.html" title="colour wheel">opaque colours</a></li>

<li><a href="../opacity/picturemenu.html" title="a menu using opacity">opaque menu</a></li>

<li><a href="../opacity/png.html" title="partial opacity">partial opacity</a></li>

<li><a href="../opacity/png2.html" title="partial opacity II">partial opacity II</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

</ul>

</div>

</body>

</html>

 

4-7网页教学网制作的网页下拉菜单(4

<!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>

content="text/html; charset=utf-8" />

<title>CSS下拉菜单</title>

<style type="text/css">

/* common styling */

.menu {font-family: arial, sans-serif; width:749px; height:30px; position:relative; margin:0; font-size:11px; margin:50px 0; background:#fff; position:relative;}

.menu ul {padding:0; margin:0; list-style-type: none;}

.menu ul li {float:left; border-left:1px solid #eee; width:106px;}

.menu ul li a, .menu ul li a:visited {display:block; float:left; width:101px; text-decoration:none; padding:0 0 0 5px; height:30px; line-height:30px; color:#000; background:#c9c9a7 url(../../graphics/drop.gif) bottom right no-repeat;}

.menu ul li ul {display: none;}

/* specific to non IE browsers */

.menu ul li:hover a {color:#fff; background:#b3ab79;}

.menu ul li:hover ul {display:block; position:absolute; width:749px; top:30px; left:0; background:#b3ab79; color:#fff;}

.menu ul li:hover ul.right_side li {float:right; border:0; border-left:1px solid #eee;}

.menu ul li:hover ul.left_side li {float:left; border:0; border-left:1px solid #eee;}

.menu ul li:hover ul li a.hide {background:#bd8d5e url(../../graphics/drop2.gif) bottom right no-repeat; color:#fff;}

.menu ul li:hover ul li:hover a.hide {background:#b3ab79; color:#fff;}

.menu ul li:hover ul li ul {display: none;}

.menu ul li:hover ul li a {display:block; background:##b3ab79; color:#fff;}

.menu ul li:hover ul li a:hover {background:#dfc184; color:#000;}

.menu ul li:hover ul li:hover ul {display:block; position:absolute; left:0; top:30px; color:#000; background:#dfc184;}

.menu ul li:hover ul.right li {float:right;}

.menu ul li:hover ul li:hover a.hide {background:#dfc184; color:#000;}

.menu ul li:hover ul li:hover ul li a {background:#dfc184; color:#000;}

.menu ul li:hover ul li:hover ul li a:hover {background:#bd8d5e; color:#fff;}

</style>

<!--[if lte IE 6]>

<style type="text/css">

table {border-collapse:collapse; margin:0; padding:0;}

.menu ul li a.hide, .menu ul li a:visited.hide {display:none;}

.menu ul li a:hover ul li a.hide {display:none;}

.menu ul li a, .menu ul li a:visited {background:#c9c9a7 url(../../graphics/drop.gif) 20px right no-repeat;}

.menu ul li a:hover {color:#fff; background:#b3ab79;}

.menu ul li a:hover ul {display:block; position:absolute; width:749px; top:30px; left:0; background:#b3ab79; color:#fff;}

.menu ul li a:hover ul.right_side li {float:right; border-width:0 1px 0 0 0;}

.menu ul li a:hover ul.left_side li {float:left;}

.menu ul li a:hover ul li a.sub {background:#bd8d5e url(../../graphics/drop2.gif) 20px right no-repeat; color:#fff;}

.menu ul li a:hover ul li a {display:block; background:#b3ab79; color:#fff;}

.menu ul li a:hover ul li a ul {visibility:hidden;}

.menu ul li a:hover ul li a:hover {background:#dfc184; color:#000;}

.menu ul li a:hover ul li a:hover ul {visibility:visible; position:absolute; left:0; top:30px; color:#000; background:#dfc184;}

.menu ul li a:hover ul li a:hover ul li a {background:#dfc184; color:#000;}

.menu ul li a:hover ul li a:hover ul li a:hover {background:#bd8d5e; color:#fff;}

</style>

<![endif]-->

</head>

<body>

<div class="menu">

<ul>

<li><a class="hide" href="../menu/index.html">DEMOS</a>

<!--[if lte IE 6]>

<a href="../menu/index.html">DEMOS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../menu/zero_dollars.html" title="The zero dollar ads page">zero dollars</a></li>

<li><a href="../menu/embed.html" title="Wrapping text around images">wrapping text</a></li>

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a class="hide" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK</a>

<!--[if lte IE 6]>

<a class="sub" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK

<table><tr><td>

<![endif]-->

<ul class="right_side">

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a href="../menu/shadow_boxing.html" title="Multi-position drop shadow">shadow boxing</a></li>

<li><a href="../menu/old_master.html" title="Image Map for detailed information">image map</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="index.html">MENUS</a>

<!--[if lte IE 6]>

<a href="index.html">MENUS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>

<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>

<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>

<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>

<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>

<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>

<li><a href="circles.html" title="circular links">circular links</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../layouts/index.html">LAYOUTS</a>

<!--[if lte IE 6]>

<a href="../layouts/index.html">LAYOUTS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../layouts/bodyfix.html" title="Cross browser fixed layout">Fixed 1</a></li>

<li><a href="../layouts/body2.html" title="Cross browser fixed layout">Fixed 2</a></li>

<li><a href="../layouts/body4.html" title="Cross browser fixed layout">Fixed 3</a></li>

<li><a href="../layouts/body5.html" title="Cross browser fixed layout">Fixed 4</a></li>

<li><a href="../layouts/minimum.html" title="A simple minimum width layout">minimum width</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../boxes/index.html">BOXES</a>

<!--[if lte IE 6]>

<a href="../boxes/index.html">BOXES

<table><tr><td>

<![endif]-->

<ul>

<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>

<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>

<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>

<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>

<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>

<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>

<li><a href="circles.html" title="circular links">circular links</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../mozilla/index.html">MOZILLA</a>

<!--[if lte IE 6]>

<a href="../mozilla/index.html">MOZILLA

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../mozilla/dropdown.html" title="A drop down menu">drop down menu</a></li>

<li><a href="../mozilla/cascade.html" title="A cascading menu">cascading menu</a></li>

<li><a href="../mozilla/content.html" title="Using content:">content:</a></li>

<li><a href="../mozilla/moxbox.html" title=":hover applied to a div">mozzie box</a></li>

<li><a href="../mozilla/rainbow.html" title="I can build a rainbow">rainbow box</a></li>

<li><a href="../mozilla/snooker.html" title="Snooker cue">snooker cue</a></li>

<li><a href="../mozilla/target.html" title="Target Practise">target practise</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../ie/index.html">EXPLORER</a>

<!--[if lte IE 6]>

<a href="../ie/index.html">EXPLORER

<table><tr><td>

<![endif]-->

<ul class="right_side">

<li><a href="../ie/exampleone.html" title="Example one">example one</a></li>

<li><a href="../ie/weft.html" title="Weft fonts">weft fonts</a></li>

<li><a href="../ie/exampletwo.html" title="Vertical align">vertical align</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../opacity/index.html">OPACITY</a>

<!--[if lte IE 6]>

<a href="../opacity/index.html">OPACITY

<table><tr><td>

<![endif]-->

<ul class="right_side">

<li><a href="../opacity/colours.html" title="colour wheel">opaque colours</a></li>

<li><a href="../opacity/picturemenu.html" title="a menu using opacity">opaque menu</a></li>

<li><a href="../opacity/png.html" title="partial opacity">partial opacity</a></li>

<li><a href="../opacity/png2.html" title="partial opacity II">partial opacity II</a></li>

<li><a class="hide" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK</a>

<!--[if lte IE 6]>

<a class="sub" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK

<table><tr><td>

<![endif]-->

<ul class="left_side">

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

</ul>

</div>

</body>

</html>

 

4-8网页教学网制作的网页下拉菜单(3

<!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>

<title>CSS下拉菜单</title>

<style type="text/css">

/* common styling */

/* set up the overall width of the menu div, the font and the margins */

.menu {

font-family: arial, sans-serif;

width:750px;

margin:0;

margin:50px 0;

}

/* remove the bullets and set the margin and padding to zero for the unordered list */

.menu ul {

padding:0;

margin:0;

list-style-type: none;

}

/* float the list so that the items are in a line and their position relative so that the drop down list will appear in the right place underneath each list item */

.menu ul li {

float:left;

position:relative;

}

/* style the links to be 104px wide by 30px high with a top and right border 1px solid white. Set the background color and the font size. */

.menu ul li a, .menu ul li a:visited {

display:block;

text-align:center;

text-decoration:none;

width:104px;

height:30px;

color:#000;

border:1px solid #fff;

border-width:1px 1px 0 0;

background:#c9c9a7;

line-height:30px;

font-size:11px;

}

/* make the dropdown ul invisible */

.menu ul li ul {

display: none;

}

/* specific to non IE browsers */

/* set the background and foreground color of the main menu li on hover */

.menu ul li:hover a {

color:#fff;

background:#b3ab79;

}

/* make the sub menu ul visible and position it beneath the main menu list item */

.menu ul li:hover ul {

display:block;

position:absolute;

top:31px;

left:0;

width:105px;

}

/* style the background and foreground color of the submenu links */

.menu ul li:hover ul li a {

display:block;

background:#faeec7;

color:#000;

}

/* style the background and forground colors of the links on hover */

.menu ul li:hover ul li a:hover {

background:#dfc184;

color:#000;

}

</style>

<!--[if lte IE 6]>

<style type="text/css">

/* styling specific to Internet Explorer IE5.5 and IE6. Yet to see if IE7 handles li:hover */

/* Get rid of any default table style */

table {

border-collapse:collapse;

margin:0;

padding:0;

}

/* ignore the link used by 'other browsers' */

.menu ul li a.hide, .menu ul li a:visited.hide {

display:none;

}

/* set the background and foreground color of the main menu link on hover */

.menu ul li a:hover {

color:#fff;

background:#b3ab79;

}

/* make the sub menu ul visible and position it beneath the main menu list item */

.menu ul li a:hover ul {

display:block;

position:absolute;

top:32px;

left:0;

width:105px;

}

/* style the background and foreground color of the submenu links */

.menu ul li a:hover ul li a {

background:#faeec7;

color:#000;

}

/* style the background and forground colors of the links on hover */

.menu ul li a:hover ul li a:hover {

background:#dfc184;

color:#000;

}

</style>

<![endif]-->

</head>

<body>

<div class="menu">

<ul>

<li><a class="hide" href="../menu/index.html">DEMOS</a>

<!--[if lte IE 6]>

<a href="../menu/index.html">DEMOS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../menu/zero_dollars.html" title="The zero dollar ads page">zero dollars</a></li>

<li><a href="../menu/embed.html" title="Wrapping text around images">wrapping text</a></li>

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a href="../menu/shadow_boxing.html" title="Multi-position drop shadow">shadow boxing</a></li>

<li><a href="../menu/old_master.html" title="Image Map for detailed information">image map</a></li>

<li><a href="../menu/bodies.html" title="fun with background images">fun backgrounds</a></li>

<li><a href="../menu/fade_scroll.html" title="fade-out scrolling">fade scrolling</a></li>

<li><a href="../menu/em_images.html" title="em size images compared">em sized images</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="index.html">MENUS</a>

<!--[if lte IE 6]>

<a href="index.html">MENUS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>

<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>

<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>

<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>

<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>

<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>

<li><a href="circles.html" title="circular links">circular links</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../layouts/index.html">LAYOUTS</a>

<!--[if lte IE 6]>

<a href="../layouts/index.html">LAYOUTS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../layouts/bodyfix.html" title="Cross browser fixed layout">Fixed 1</a></li>

<li><a href="../layouts/body2.html" title="Cross browser fixed layout">Fixed 2</a></li>

<li><a href="../layouts/body4.html" title="Cross browser fixed layout">Fixed 3</a></li>

<li><a href="../layouts/body5.html" title="Cross browser fixed layout">Fixed 4</a></li>

<li><a href="../layouts/minimum.html" title="A simple minimum width layout">minimum width</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../boxes/index.html">BOXES</a>

<!--[if lte IE 6]>

<a href="../boxes/index.html">BOXES

<table><tr><td>

<![endif]-->

<ul>

<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>

<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>

<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>

<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>

<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>

<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>

<li><a href="circles.html" title="circular links">circular links</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../mozilla/index.html">MOZILLA</a>

<!--[if lte IE 6]>

<a href="../mozilla/index.html">MOZILLA

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../mozilla/dropdown.html" title="A drop down menu">drop down menu</a></li>

<li><a href="../mozilla/cascade.html" title="A cascading menu">cascading menu</a></li>

<li><a href="../mozilla/content.html" title="Using content:">content:</a></li>

<li><a href="../mozilla/moxbox.html" title=":hover applied to a div">mozzie box</a></li>

<li><a href="../mozilla/rainbow.html" title="I can build a rainbow">rainbow box</a></li>

<li><a href="../mozilla/snooker.html" title="Snooker cue">snooker cue</a></li>

<li><a href="../mozilla/target.html" title="Target Practise">target practise</a></li>

<li><a href="../mozilla/splittext.html" title="Two tone headings">two tone headings</a></li>

<li><a href="../mozilla/shadow_text.html" title="Shadow text">shadow text</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../ie/index.html">EXPLORER</a>

<!--[if lte IE 6]>

<a href="../ie/index.html">EXPLORER

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../ie/exampleone.html" title="Example one">example one</a></li>

<li><a href="../ie/weft.html" title="Weft fonts">weft fonts</a></li>

<li><a href="../ie/exampletwo.html" title="Vertical align">vertical align</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../opacity/index.html">OPACITY</a>

<!--[if lte IE 6]>

<a href="../opacity/index.html">OPACITY

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../opacity/colours.html" title="colour wheel">opaque colours</a></li>

<li><a href="../opacity/picturemenu.html" title="a menu using opacity">opaque menu</a></li>

<li><a href="../opacity/png.html" title="partial opacity">partial opacity</a></li>

<li><a href="../opacity/png2.html" title="partial opacity II">partial opacity II</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

</ul>

<!-- clear the floats if required -->

<div class="clear"> </div>

</div>

</body>

</html>

4-9网页教学网制作的网页下拉菜单(2

<!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>

content="text/html; charset=utf-8" />

<title>CSS下拉菜单</title>

<style type="text/css">

/* common styling */

.menu {font-family: arial, sans-serif; width:750px; position:relative; margin:0; font-size:11px; margin:50px 0;}

.menu ul li a, .menu ul li a:visited {display:block; text-decoration:none; color:#000;width:104px; height:20px; text-align:center; color:#fff; border:1px solid #fff; background:#710069; line-height:20px; font-size:11px; overflow:hidden;}

.menu ul {padding:0; margin:0;list-style-type: none; }

.menu ul li {float:left; margin-right:1px; position:relative;}

.menu ul li ul {display: none;}

/* specific to non IE browsers */

.menu ul li:hover a {color:#fff; background:#36f;}

.menu ul li:hover ul {display:block; position:absolute; top:21px; left:0; width:105px;}

.menu ul li:hover ul li a.hide {background:#6a3; color:#fff;}

.menu ul li:hover ul li:hover a.hide {background:#6fc; color:#000;}

.menu ul li:hover ul li ul {display: none;}

.menu ul li:hover ul li a {display:block; background:#ddd; color:#000;}

.menu ul li:hover ul li a:hover {background:#6fc; color:#000;}

.menu ul li:hover ul li:hover ul {display:block; position:absolute; left:105px; top:0;}

.menu ul li:hover ul li:hover ul.left {left:-105px;}

</style>

<!--[if lte IE 6]>

<style type="text/css">

.menu ul li a.hide, .menu ul li a:visited.hide {display:none;}

.menu ul li a:hover ul li a.hide {display:none;}

.menu ul li a:hover {color:#fff; background:#36f;}

.menu ul li a:hover ul {display:block; position:absolute; top:21px; left:0; width:105px;}

.menu ul li a:hover ul li a.sub {background:#6a3; color:#fff;}

.menu ul li a:hover ul li a {display:block; background:#ddd; color:#000;}

.menu ul li a:hover ul li a ul {visibility:hidden;}

.menu ul li a:hover ul li a:hover {background:#6fc; color:#000;}

.menu ul li a:hover ul li a:hover ul {visibility:visible; position:absolute; left:105px; top:0; color:#000;}

.menu ul li a:hover ul li a:hover ul.left {left:-105px;}

</style>

<![endif]-->

</head>

<body>

<div class="menu">

<ul>

<li><a class="hide" href="../menu/index.html">DEMOS</a>

<!--[if lte IE 6]>

<a href="../menu/index.html">DEMOS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../menu/zero_dollars.html" title="The zero dollar ads page">zero dollars</a></li>

<li><a href="../menu/embed.html" title="Wrapping text around images">wrapping text</a></li>

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a class="hide" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK &gt;</a>

<!--[if lte IE 6]>

<a class="sub" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK &gt;

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a href="../menu/shadow_boxing.html" title="Multi-position drop shadow">shadow boxing</a></li>

<li><a href="../menu/old_master.html" title="Image Map for detailed information">image map</a></li>

<li><a href="../menu/bodies.html" title="fun with background images">fun backgrounds</a></li>

<li><a href="../menu/fade_scroll.html" title="fade-out scrolling">fade scrolling</a></li>

<li><a href="../menu/em_images.html" title="em size images compared">em sized images</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="index.html">MENUS</a>

<!--[if lte IE 6]>

<a href="index.html">MENUS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>

<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>

<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>

<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>

<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>

<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>

<li><a href="circles.html" title="circular links">circular links</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../layouts/index.html">LAYOUTS</a>

<!--[if lte IE 6]>

<a href="../layouts/index.html">LAYOUTS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../layouts/bodyfix.html" title="Cross browser fixed layout">Fixed 1</a></li>

<li><a href="../layouts/body2.html" title="Cross browser fixed layout">Fixed 2</a></li>

<li><a href="../layouts/body4.html" title="Cross browser fixed layout">Fixed 3</a></li>

<li><a href="../layouts/body5.html" title="Cross browser fixed layout">Fixed 4</a></li>

<li><a href="../layouts/minimum.html" title="A simple minimum width layout">minimum width</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../boxes/index.html">BOXES</a>

<!--[if lte IE 6]>

<a href="../boxes/index.html">BOXES

<table><tr><td>

<![endif]-->

<ul>

<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>

<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>

<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>

<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>

<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>

<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>

<li><a href="circles.html" title="circular links">circular links</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../mozilla/index.html">MOZILLA</a>

<!--[if lte IE 6]>

<a href="../mozilla/index.html">MOZILLA

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../mozilla/dropdown.html" title="A drop down menu">drop down menu</a></li>

<li><a href="../mozilla/cascade.html" title="A cascading menu">cascading menu</a></li>

<li><a href="../mozilla/content.html" title="Using content:">content:</a></li>

<li><a href="../mozilla/moxbox.html" title=":hover applied to a div">mozzie box</a></li>

<li><a href="../mozilla/rainbow.html" title="I can build a rainbow">rainbow box</a></li>

<li><a href="../mozilla/snooker.html" title="Snooker cue">snooker cue</a></li>

<li><a href="../mozilla/target.html" title="Target Practise">target practise</a></li>

<li><a href="../mozilla/splittext.html" title="Two tone headings">two tone headings</a></li>

<li><a href="../mozilla/shadow_text.html" title="Shadow text">shadow text</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../ie/index.html">EXPLORER</a>

<!--[if lte IE 6]>

<a href="../ie/index.html">EXPLORER

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../ie/exampleone.html" title="Example one">example one</a></li>

<li><a href="../ie/weft.html" title="Weft fonts">weft fonts</a></li>

<li><a href="../ie/exampletwo.html" title="Vertical align">vertical align</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../opacity/index.html">OPACITY</a>

<!--[if lte IE 6]>

<a href="../opacity/index.html">OPACITY

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../opacity/colours.html" title="colour wheel">opaque colours</a></li>

<li><a href="../opacity/picturemenu.html" title="a menu using opacity">opaque menu</a></li>

<li><a href="../opacity/png.html" title="partial opacity">partial opacity</a></li>

<li><a href="../opacity/png2.html" title="partial opacity II">partial opacity II</a></li>

<li><a class="hide" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">&lt; HOVER/CLICK</a>

<!--[if lte IE 6]>

<a class="sub" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">&lt; HOVER/CLICK

<table><tr><td>

<![endif]-->

<ul class="left">

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

</ul>

</div>

</body>

</html>

 

4-10网页教学网制作的网页下拉菜单(1

<!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>

content="text/html; charset=utf-8" />

<title>CSS下拉菜单</title>

<style type="text/css">

/* common styling */

.menu {font-family: arial, sans-serif; width:106px; height:150px; position:relative; margin:0; font-size:11px; margin:50px 0;}

.menu ul li a, .menu ul li a:visited {display:block; text-decoration:none; color:#000;width:104px; height:20px; text-align:center; color:#fff; border:1px solid #aaa; background:#710069; line-height:20px; font-size:11px; overflow:hidden;}

.menu ul {padding:0; margin:0;list-style-type: none; }

.menu ul li {float:left; margin-right:1px; position:relative;}

.menu ul li ul {display: none;}

/* specific to non IE browsers */

.menu ul li:hover a {color:#fff; background:#36f;}

.menu ul li:hover ul {display:block; position:absolute; top:0; left:105px; width:105px;}

.menu ul li:hover ul li a.hide {background:#6a3; color:#fff;}

.menu ul li:hover ul li:hover a.hide {background:#6fc; color:#000;}

.menu ul li:hover ul li ul {display: none;}

.menu ul li:hover ul li a {display:block; background:#eee; color:#000;}

.menu ul li:hover ul li a:hover {background:#6fc; color:#000;}

.menu ul li:hover ul li:hover ul {display:block; position:absolute; left:105px; top:0;}

</style>

<!--[if lte IE 6]>

<style type="text/css">

.menu ul li a.hide, .menu ul li a:visited.hide {display:none;}

.menu ul li a:hover ul li a.hide {display:none;}

.menu ul li a:hover {color:#fff; background:#36f;}

.menu ul li a:hover ul {display:block; position:absolute; top:0; left:105px; width:105px;}

.menu ul li a:hover ul li a.sub {background:#6a3; color:#fff;}

.menu ul li a:hover ul li a {display:block; background:#eee; color:#000;}

.menu ul li a:hover ul li a ul {visibility:hidden;}

.menu ul li a:hover ul li a:hover {background:#6fc; color:#000;}

.menu ul li a:hover ul li a:hover ul {visibility:visible; position:absolute; left:105px; top:0; color:#000;}

</style>

<![endif]-->

</head>

<body>

<div class="menu">

<ul>

<li><a class="hide" href="../menu/index.html">DEMOS</a>

<!--[if lte IE 6]>

<a href="../menu/index.html">DEMOS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../menu/zero_dollars.html" title="The zero dollar ads page">zero dollars</a></li>

<li><a href="../menu/embed.html" title="Wrapping text around images">wrapping text</a></li>

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a class="hide" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK &gt;</a>

<!--[if lte IE 6]>

<a class="sub" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK &gt;

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>

<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>

<li><a href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a href="../menu/shadow_boxing.html" title="Multi-position drop shadow">shadow boxing</a></li>

<li><a href="../menu/old_master.html" title="Image Map for detailed information">image map</a></li>

<li><a href="../menu/bodies.html" title="fun with background images">fun backgrounds</a></li>

<li><a href="../menu/fade_scroll.html" title="fade-out scrolling">fade scrolling</a></li>

<li><a href="../menu/em_images.html" title="em size images compared">em sized images</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="index.html">MENUS</a>

<!--[if lte IE 6]>

<a href="index.html">MENUS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>

<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>

<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>

<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>

<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>

<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>

<li><a href="circles.html" title="circular links">circular links</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../layouts/index.html">LAYOUTS</a>

<!--[if lte IE 6]>

<a href="../layouts/index.html">LAYOUTS

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../layouts/bodyfix.html" title="Cross browser fixed layout">Fixed 1</a></li>

<li><a href="../layouts/body2.html" title="Cross browser fixed layout">Fixed 2</a></li>

<li><a href="../layouts/body4.html" title="Cross browser fixed layout">Fixed 3</a></li>

<li><a href="../layouts/body5.html" title="Cross browser fixed layout">Fixed 4</a></li>

<li><a href="../layouts/minimum.html" title="A simple minimum width layout">minimum width</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../boxes/index.html">BOXES</a>

<!--[if lte IE 6]>

<a href="../boxes/index.html">BOXES

<table><tr><td>

<![endif]-->

<ul>

<li><a href="spies.html" title="a coded list of spies">spies menu</a></li>

<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>

<li><a href="expand.html" title="an enlarging unordered list">enlarging list</a></li>

<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>

<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>

<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>

<li><a href="circles.html" title="circular links">circular links</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../mozilla/index.html">MOZILLA</a>

<!--[if lte IE 6]>

<a href="../mozilla/index.html">MOZILLA

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../mozilla/dropdown.html" title="A drop down menu">drop down menu</a></li>

<li><a href="../mozilla/cascade.html" title="A cascading menu">cascading menu</a></li>

<li><a href="../mozilla/content.html" title="Using content:">content:</a></li>

<li><a href="../mozilla/moxbox.html" title=":hover applied to a div">mozzie box</a></li>

<li><a href="../mozilla/rainbow.html" title="I can build a rainbow">rainbow box</a></li>

<li><a href="../mozilla/snooker.html" title="Snooker cue">snooker cue</a></li>

<li><a href="../mozilla/target.html" title="Target Practise">target practise</a></li>

<li><a href="../mozilla/splittext.html" title="Two tone headings">two tone headings</a></li>

<li><a href="../mozilla/shadow_text.html" title="Shadow text">shadow text</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../ie/index.html">EXPLORER</a>

<!--[if lte IE 6]>

<a href="../ie/index.html">EXPLORER

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../ie/exampleone.html" title="Example one">example one</a></li>

<li><a href="../ie/weft.html" title="Weft fonts">weft fonts</a></li>

<li><a href="../ie/exampletwo.html" title="Vertical align">vertical align</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

<li><a class="hide" href="../opacity/index.html">OPACITY</a>

<!--[if lte IE 6]>

<a href="../opacity/index.html">OPACITY

<table><tr><td>

<![endif]-->

<ul>

<li><a href="../opacity/colours.html" title="colour wheel">opaque colours</a></li>

<li><a href="../opacity/picturemenu.html" title="a menu using opacity">opaque menu</a></li>

<li><a href="../opacity/png.html" title="partial opacity">partial opacity</a></li>

<li><a href="../opacity/png2.html" title="partial opacity II">partial opacity II</a></li>

</ul>

<!--[if lte IE 6]>

</td></tr></table>

</a>

<![endif]-->

</li>

</ul>

</div>

</body>

</html>

 

4-11树形导航{tx},CSS{tx}代码

<!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>

content="text/html; charset=gb2312" />

<title>css实现的目录树型导航菜单</title>

<style>

ul { padding:0; margin:0;}

#main1,#main2 { width:100px; height:28px; line-height:28px; padding-left:5px; background:#ccc; cursor:pointer; border-bottom:1px solid #fff;}

#child1,#child2 { width:105px; background:#eee;}

#child1 ul li,#child2 ul li { padding-left:5px; border-bottom:1px solid #fff; line-height:180%;}

#child1 ul li a,#child2 ul li a { color:#666;}

</style>

</head>

<body>

<div id="main1" onClick="document.all.child1.style.display=(document.all.child1.style.display =='none')?'':'none'" > + 主目录1</div>

<div id="child1" style="display:none">

<ul>

<li><a href="#">- 子目录1</a></li>

<li><a href="#">- 子目录2</a></li>

<li><a href="#">- 子目录3</a></li>

<li><a href="#">- 子目录4</a></li>

</ul>

</div>

<div id="main2" onClick="document.all.child2.style.display=(document.all.child2.style.display =='none')?'':'none'" > + 主目录2 </div>

<div id="child2" style="display:none">

<ul>

<li><a href="#">- 子目录1</a></li>

<li><a href="#">- 子目录2</a></li>

<li><a href="#">- 子目录3</a></li>

<li><a href="#">- 子目录4</a> </li>

</ul>

</div>

<p><a href="http://www.webjx.com">来自网页教学网www.webjx.com</a></p>

</body>

</html>

 

4-12{tx}代码:区别网页链接访问与未访问(html

<!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>

content="text/html; charset=gb2312" />

<title>{tx}代码:区别网页链接访问与未访问--网页教学网webjx.com</title>

<style>

body { font-size:12px; line-height:180%; }

ul { padding:10px; margin:0; list-style:none; }

ul li a { background:url(http://www.webjx.com/files/090207/1_212738.gif) 0 center no-repeat; padding-left:20px; color:#04d; }

ul li a:visited { background:url(http://www.webjx.com/files/090207/1_212715.gif) 0 center no-repeat; color:#999; }

</style>

</head>

<body>

<p>将已访问的链接标记为已读,点击以下任意链接看一下</p>

<div>

<ul>

<li><a href="http://www.webjx.com/css/divcss-9341.html" target="_blank">选择正确DOCTYPE解决CSS在网页失效问题</a> </li>

<li><a href="http://www.webjx.com/javascript/jsajax-9340.html" target="_blank">Javascript校验含中文的字符串长度</a></li>

<li><a href="http://www.webjx.com/html-xhtml/webxhtml-9339.html" target="_blank">链接A的语义、写法和{zj0}实践</a> </li>

<li><a href="http://www.webjx.com/html-xhtml/webxhtml-9338.html" target="_blank">英文:A链接标记ie下会自动补全href</a></li>

<li><a href="http://www.webjx.com/javascript/jsajax-9337.html" target="_blank">掌握JavaScript语言</a> </li>

<li><a href="http://www.webjx.com/javascript/jsajax-9336.html" target="_blank">编写复杂环境下不出错的Javascript代码</a> </li>

<li><a href="http://www.webjx.com/javascript/jsajax-9335.html" target="_blank">JavaScript内置对象:arguments</a></li>

<li><a href="http://www.webjx.com/javascript/jsajax-9334.html" target="_blank">JavaScript类型检测小结</a></li>

<li><a href="http://www.webjx.com/javascript/jsajax-9333.html" target="_blank">JavaScript教程:浅析JS运行机制</a></li>

</ul>

</div>

</body>

</html>

 

4-13 XHTML+CSS制作的网站导航菜单

<!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>

<title>站酷CSS代码演示-http://www.webjx.com</title>

content="text/html; charset=utf-8" />

<style type="text/css">

body{

background-color:white;

font-size:12px;

font-family:Arial, Helvetica, sans-serif;

margin:0px;

padding:0px;

color:white;

}

ul,li{

margin:0px;

padding:0px;

}

li{

display:inline;

list-style:none;

list-style-position:outside;

text-align:center;

font-weight:bold;

float:left;

}

a:link{

color:#336601;

text-decoration:none;

float:left;

width:100px;

padding:3px 5px 0px 5px;

}

a:visited{

color:#336601;

text-decoration:none;

float:left;

padding:3px 5px 0px 5px;

width:100px;

}

a:hover{

color:white;

float:left;

padding:3px 3px 0px 20px;

width:88px;

text-decoration:none;

background-color:#539D26;

}

a:active{

color:white;

float:left;

padding:3px 3px 0px 20px;

width:88px;

text-decoration:none;

background-color:#539D26;

}

#nav{

width:600px;

height:30px;

border-bottom:0px;

padding:0px 5px;

position:absolute;

z-index:1;

left: 198px;

top: 25px;

}

.list{

line-height:20px;

text-align:left;

padding:4px;

font-weight:normal;

}

.menu1{

width:120px;

height:auto;

margin:6px 4px 0px 0px;

border:1px solid #9CDD75;

background-color:#F1FBEC;

color:#336601;

padding:6px 0px 0px 0px;

cursor:hand;

overflow-y:hidden;

filter:Alpha(opacity=70);

-moz-opacity:0.7;

}

.menu2{

width:120px;

height:18px;

margin:6px 4px 0px 0px;

background-color:#F5F5F5;

color:#999999;

border:1px solid #EEE8DD;

padding:6px 0px 0px 0px;

overflow-y:hidden;

cursor:hand;

}

</style>

</head>

<body>

<div id="nav">

<ul>

<li class="menu2" onMouseOver="this.className='menu1'" onMouseOut="this.className='menu2'">站酷首页

<div class="list">

<a href="#">我的Png</a><br />

<a href="#">我的Gif</a><br />

<a href="#">我的酷站</a><br />

<a href="#">我的日志</a><br />

<a href="#">我的相册</a><br />

<a href="#">我的收藏</a><br />

</div>

</li>

<li class="menu2" onMouseOver="this.className='menu1'" onMouseOut="this.className='menu2'">社区圈子

<div class="list">

<a href="#">我的CHINAY</a><br />

<a href="#">我的首页</a><br />

<a href="#">我的日志</a><br />

<a href="#">我的相册</a><br />

<a href="#">我的收藏</a><br />

</div>

</li>

<li class="menu2" onMouseOver="this.className='menu1'" onMouseOut="this.className='menu2'">我的短信

<div class="list">

<a href="#">我的CHINAY</a><br />

<a href="#">我的相册</a><br />

<a href="#">我的收藏</a><br />

</div>

</li>

<li class="menu2" onMouseOver="this.className='menu1'" onMouseOut="this.className='menu2'">账户管理

<div class="list">

<a href="#">我的CHINAY</a><br />

<a href="#">我的首页</a><br />

<a href="#">我的日志</a><br />

<a href="#">我的相册</a><br />

<a href="#">我的收藏</a><br />

<a href="#">我的日志</a><br />

<a href="#">我的相册</a><br />

<a href="#">我的收藏</a><br />

</div>

</li>

</ul>

</div>

</body>

</html>

 

4-14左侧菜单点击变色效果

<!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>

content="text/html; charset=gb2312" />

<title>无标题文档</title>

<style type="text/css">

body{font-size:12px;}

ul,li,h2{margin:0;padding:0;}

ul{list-style:none;}

#top{width:900px;height:40px;margin:0 auto;background-color:#CCCC00}

#top h2{width:150px;height:40px;background-color:#99CC00;float:left;font-size:14px;text-align:center;line-height:40px;}

#topTags{width:750px;height:40px;margin:0 auto;background-color:#CCCC00;float:left}

#topTags ul li{float:left;width:100px;height:25px;margin-right:5px;display:block;text-align:center;cursor:pointer;padding-top:15px;}

#main{width:900px;height:500px;margin:0 auto;background-color:#F5F7E6;}

#leftMenu{width:150px;height:500px;background-color:#009900;float:left}

#leftMenu ul{margin:10px;}

#leftMenu ul li{width:130px;height:30px;display:block;background:#99CC00;cursor:pointer;line-height:30px;text-align:center;margin-bottom:5px;}

#leftMenu ul li a{color:#000000;text-decoration:none;}

#content{width:750px;height:500px;float:left}

.content{width:740px;height:490px;display:none;padding:5px;overflow-y:auto;line-height:30px;}

#footer{width:900px;height:30px;margin:0 auto;background-color:#ccc;line-height:30px;text-align:center;}

.content1 {width:740px;height:490px;display:block;padding:5px;overflow-y:auto;line-height:30px;}

</style>

<script type="text/javascript">

window.onload=function(){

function $(id){return document.getElementById(id)}

var menu=$("topTags").getElementsByTagName("ul")[0];//顶部菜单容器

var tags=menu.getElementsByTagName("li");//顶部菜单

var ck=$("leftMenu").getElementsByTagName("ul")[0].getElementsByTagName("li");//左侧菜单

var j;

//点击左侧菜单增加新标签

for(i=0;i<ck.length;i++){

ck[i].onclick=function(){

$("welcome").style.display="none"//欢迎内容隐藏

clearMenu();

this.style.background="yellow";

//循环取得当前索引

for(j=0;j<8;j++){

if(this==ck[j]){

if($("p"+j)==null){

openNew(j,this.innerHTML);//设置标签显示文字

}

clearStyle();

$("p"+j).style.backgroundColor="yellow";

clearContent();

$("c"+j).style.display="block";

}

}

return false;

}

}

//增加或删除标签

function openNew(id,name){

var tagMenu=document.createElement("li");

tagMenu.id="p"+id;

tagMenu.innerHTML=name+"&nbsp;&nbsp;&nbsp;"+"<img src='/files/allimg/080516/0150550.gif' style='vertical-align:middle'/>";

//标签点击事件

tagMenu.onclick=function(evt){

clearMenu();

ck[id].style.background="yellow";

clearStyle();

tagMenu.style.backgroundColor="yellow";

clearContent();

$("c"+id).style.display="block";

}

//标签内关闭图片点击事件

tagMenu.getElementsByTagName("img")[0].onclick=function(evt){

evt=(evt)?evt:((window.event)?window.event:null);

if(evt.stopPropagation){evt.stopPropagation()} //取消operaSafari冒泡行为;

this.parentNode.parentNode.removeChild(tagMenu);//删除当前标签

var color=tagMenu.style.backgroundColor;

//设置如果关闭一个标签时,让{zh1}一个标签得到焦点

if(color=="#ffff00"||color=="yellow"){//区别浏览器对颜色解释

if(tags.length-1>=0){

clearStyle();

tags[tags.length-1].style.backgroundColor="yellow";

clearContent();

var cc=tags[tags.length-1].id.split("p");

$("c"+cc[1]).style.display="block";

clearMenu();

ck[cc[1]].style.background="yellow";

}

else{

clearContent();

clearMenu();

$("welcome").style.display="block"

}

}

}

menu.appendChild(tagMenu);

}

//xx菜单样式

function clearMenu(){

for(i=0;i<ck.length;i++){

ck[i].style.background="#99CC00";

}

}

//xx标签样式

function clearStyle(){

for(i=0;i<tags.length;i++){

menu.getElementsByTagName("li")[i].style.backgroundColor="#FFCC00";

}

}

//xx内容

function clearContent(){

for(i=0;i<7;i++){

$("c"+i).style.display="none";

}

}

}

</script>

</head>

<body>

<div id="top">

<h2>管理菜单</h2>

<div id="topTags">

<ul>

</ul>

</div>

</div>

<div id="main">

<div id="leftMenu">

<ul>

<li>个人资料</li>

<li>相册管理</li>

<li>日志管理</li>

<li>留言管理</li>

<li>风格管理</li>

<li>系统管理</li>

<li>帮助信息</li>

</ul>

</div>

<div id="content">

<div id="welcome" class="content" style="display:block;">

<div align="center">

<p>&nbsp;</p>

<p><strong>欢迎使用用户管理系统!</strong></p>

<p>&nbsp;</p>

</div>

</div>

<div id="c0" class="content">个人资料</div>

<div id="c1" class="content">相册管理</div>

<div id="c2" class="content">日志管理</div>

<div id="c3" class="content">留言管理</div>

<div id="c4" class="content">风格管理</div>

<div id="c5" class="content">系统管理</div>

<div id="c6" class="content">帮助信息</div>

</div>

</div>

<div id="footer">copyright for lalasxc </div>

</body>

</html>

4-15 js:商品分类后有一个方框指向到搜索栏

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<HEAD>

<TITLE>方框移动</TITLE>

content="text/html; charset=GBK">

<style language="javascript">

<!--

body, td{

font-size: 9pt;

}

-->

</style>

</HEAD>

<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!--

var speed=10;//速度

var ci = 10;//运动次数

var left=0;//方框左位置

var top=0;//方框上位置

var width=0;//方框宽

var height=0;//方框高

var aimleft=0;//目标左位置

var aimtop=0;//目标上位置

var aimwidth=0;//目标宽

var aimheight=0;//目标高

var lb=0;//左步长

var tb=0;//上步长

var wb=0;//宽步长

var hb=0;//高步长

var fk = null;

var aim = null;

function initObj(){

if (!fk){fk = document.getElementById('fk');}

if (!aim){aim = document.getElementById('aim');}

}

/*

* 取得对象位置、大小

* 取得目标对象位置、大小

*/

function setSource(obj){

initObj();

left      = getOffset(obj).Left;

top       = getOffset(obj).Top;

width     = obj.offsetWidth;

height    = obj.offsetHeight;

aimleft   = getOffset(aim).Left;

aimtop    = getOffset(aim).Top;

aimwidth  = aim.offsetWidth;

aimheight = aim.offsetHeight;

fk.style.display='';

clearInterval(MyMar);

}

/**

* 设置方向步长、宽高步长

*/

function setStep(){

lb = (aimleft-left)/ci;

tb = (aimtop-top)/ci;

wb = (aimwidth-width)/ci;

hb = (aimheight-height)/ci;

}

/**

* 移动

*/

function move(){

setStep();

left+=lb;

top+=tb;

width+=wb;

height+=hb;

if(left<aimleft-2 || top<aimtop-2 || width<aimwidth-2 || height<aimheight-2){

fk.style.left = left+"px";

fk.style.top = top+"px";

fk.style.width = width+"px";

fk.style.height = height+"px";

}else{

hiddenFK();

clearInterval(MyMar)

}

}

function hiddenFK(){

initObj();

fk.style.display='none';

}

/**

* 取得某元素在页面中相对页面左上顶点的位置

*/

function getOffset(obj){

var offsetleft = obj.offsetLeft;

var offsettop = obj.offsetTop;

while (obj.offsetParent != document.body)

{

obj = obj.offsetParent;

offsetleft += obj.offsetLeft;

offsettop += obj.offsetTop;

}

return {Left : offsetleft, Top : offsettop};

}

var MyMar=setInterval(move,speed);

//-->

</SCRIPT>

<div id="fk" style="position: absolute; width: 46px; height: 20px; border: 1px solid #000000 ; display: none"></div>

<TABLE style="border: 1px solid #666666" cellspacing=1 bgcolor=#ff1111 cellpadding=4 border=0>

<TR bgcolor=#ffffff>

<TD onClick="setSource(this);MyMar=setInterval(move,speed)">笔记本</TD>

<TD onClick="setSource(this);{MyMar=setInterval(move,speed)}">小家电</TD>

<TD onClick="setSource(this);{MyMar=setInterval(move,speed)}">电冰箱</TD>

<TD onClick="setSource(this);{MyMar=setInterval(move,speed)}">波比娃娃</TD>

<TD onClick="setSource(this);{MyMar=setInterval(move,speed)}">小家电</TD>

<TD onClick="setSource(this);{MyMar=setInterval(move,speed)}">小家电</TD>

</TR>

</TABLE>

<br><br>

<br><br>

<br><br>

<TABLE id="aim" style="border: 1px solid #666666 ; width: 227px; height: 300px;">

<TR>

<TD></TD>

</TR>

</TABLE>

<br>

<br>

<br>

<br>

<TABLE style="border: 1px solid #666666" cellspacing=1 bgcolor=#ff1111 cellpadding=4 border=0>

<TR bgcolor=#ffffff>

<TD onClick="setSource(this);{MyMar=setInterval(move,speed)}">笔记本</TD>

<TD onClick="setSource(this);{MyMar=setInterval(move,speed)}">小家电</TD>

<TD onClick="setSource(this);{MyMar=setInterval(move,speed)}">电冰箱</TD>

<TD onClick="setSource(this);{MyMar=setInterval(move,speed)}">波比娃娃</TD>

<TD onClick="setSource(this);{MyMar=setInterval(move,speed)}">小家电</TD>

<TD onClick="setSource(this);{MyMar=setInterval(move,speed)}">小家电</TD>

</TR>

</TABLE>

</BODY>

</HTML>

 

4-16网页设计中不错的二级导航菜单{tx}

<!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>

<title>Horizontal Drop Down Menus</title>

content="text/html; charset=gb2312" />

<script type=text/javascript>

/**

*菜单的构造,需要绑定到onload

*/

startList = function() {

if (document.all&&document.getElementById) {

dropmenuRoot = document.getElementById("dropmenu");

for (i=0; i<dropmenuRoot.childNodes.length; i++) {

node = dropmenuRoot.childNodes[i];

if (node.nodeName=="LI") {

node.onmouseover=function() {

this.className+=" over";

//开始灌水

for(j=0;j<this.childNodes.length;j++){

if (this.childNodes[j].nodeName=="UL"){

if (this.childNodes[j].childNodes[0].nodeName=="LI"){

if (this.offsetLeft+this.childNodes[j].childNodes.length*this.childNodes[j].childNodes[0].offsetWidth-dropmenuRoot.offsetLeft>dropmenuRoot.offsetWidth){

var len=this.childNodes[j].childNodes.length*this.childNodes[j].childNodes[0].offsetWidth; //菜单的长度

(len>dropmenuRoot.offsetWidth) ? this.childNodes[j].style.width=776+"px" : this.childNodes[j].style.width=len+"px"; //ul设置宽度 如果子菜单比较多,大于容器的宽度,那么ul的宽度就是容器的宽度

len =this.offsetLeft+len-dropmenuRoot.offsetLeft-dropmenuRoot.offsetWidth;

(len>this.offsetLeft-dropmenuRoot.offsetLeft) ? this.childNodes[j].style.marginLeft=-(this.offsetLeft-dropmenuRoot.offsetLeft) : this.childNodes[j].style.marginLeft=-len+"px";

}

}

}

}

}

//灌水完毕

node.onmouseout=function() {

this.className=this.className.replace(" over", "");

}

}

}

}

}

window.onload=startList;

</script>

</head>

<style type="text/css">

body { font: normal 11px verdana; background: #45b97c; position:absolute }

ul { margin: 0; padding: 0; }

li { list-style-position: outside; list-style: none;}

a { text-decoration: none; color: #666;}

ul#dropmenu,ul#dropmenu ul{

margin: 0 auto;

text-align: left;

padding: 0;

list-style: none;

z-index: 99;

}

ul#dropmenu {

width: 774px;

display: block;

height: 24px;

clear: both;

border: 1px solid #ccc;

text-align: center;

background: #fff;

}

ul#dropmenu li {

position: relative;

z-index: 999;

float: left;

}

ul#dropmenu ul li{

float: left;

display: block;

}

ul#dropmenu ul {

/*width: 122px;

w\idth: 120px;*/

height: auto;

position: absolute;

text-align: left;

left: 0px;

display: none;

border: solid 1px #ccc;

}

/*当鼠标在子菜单和父菜单上时,父菜单的样式*/

ul#dropmenu li.over a,ul#dropmenu li:hover a{

border-color: #ccc;

background: #c00;

color: #fff;

}

/*将子菜单的样式xx*/

ul#dropmenu li.over ul a,ul#dropmenu li:hover ul a{

font-weight: normal;

color: #666;

background: #fff;;

}

/*子菜单的hover样式*/

ul#dropmenu li.over ul a:hover,ul#dropmenu li:hover ul a:hover{

font-weight: normal;

color: #cc0000;

font-weight: bold;

background: #f6f6f6;

}

/* Styles for Menu Items */

ul#dropmenu a {

display: block;

padding: 0 0 0 10px;

width: 106px;

w\idth: 96px;

color: #666;

line-height: 24px;

}

ul#dropmenu ul li{

width: 110px;

border: 0;

}

/* End */

ul#dropmenu ul a {

FILTER: progid:DXImageTransform.Microsoft.Alpha(opacity=70); /* 透明 */

padding: 2px 0px 2px 10px;

border: 0;

width: 120px;

w\idth: 110px;/* Sub Menu Styles */

}

ul#dropmenu li:hover ul,ul#dropmenu li.over ul {

display: block; /* The magic */

}

</style>

<body>

<div id="nav">

<ul id="dropmenu">

<li><a href="#">Home</a></li>

<li><a href="#">About</a>

<ul>

<li><a href="#">History</a></li>

<li><a href="#">Team</a></li>

<li><a href="#">Drop Down Menu</a></li>

<li><a href="#">Offices</a></li>

</ul>

</li>

<li><a href="#">Services</a>

<ul>

<li><a href="#">History</a></li>

<li><a href="#">Team</a></li>

<li><a href="#">Drop Down Menu</a></li>

<li><a href="#">Offices</a></li>

</ul>

</li>

<li><a href="#">Home</a></li>

<li><a href="#">About</a>

<ul>

<li><a href="#">History</a></li>

<li><a href="#">Team</a></li>

<li><a href="#">Drop Down Menu</a></li>

<li><a href="#">Offices</a></li> <li><a href="#">History</a></li>

<li><a href="#">Team</a></li>

</ul>

</li>

<li><a href="#">Services</a>

<ul>

<li><a href="#">History</a></li>

<li><a href="#">Team</a></li>

<li><a href="#">Drop Down Menu</a></li>

<li><a href="#">Offices</a></li>

<li><a href="#">History</a></li>

<li><a href="#">Team</a></li>

<li><a href="#">Drop Down Menu</a></li>

<li><a href="#">Offices</a></li>

<li><a href="#">History</a></li>

<li><a href="#">Team</a></li>

<li><a href="#">Drop Down Menu</a></li>

</ul>

</li>

<li><a href="#">Home</a></li>

</ul>

</div>

</body>

</html>

 

4-17个比较有用的特殊选项卡{tx}代码

<style type="text/css">

body {

margin:0px;

text-align:center;

font-size:12px;

}

#divall {

margin:auto;

margin-top:35px;

width:300px;

height:200px;

background-color:#7DA7D9;

border:0px;

}

#title {

width:300px;

height:20px;

font-size:14px;

margin-top:4px;

}

#table1 table {

width:300px;

height:30px;

font-size:12px;

}

#table2 table {

width:300px;

height:30px;

font-size:12px;

}

#content1,#content2,#content3,#content4,#content5,#content6,#msg1,#msg2 {

margin:auto;

height:110px;

width:290px;

background-color:#eee;

position:relative;

}

#content1 div,#content2 div,#content3 div,#content4 div,#content5 div,#content6 div {

position:absolute;

bottom:3px;

right:3px;

cursor:pointer;

}

a {

text-decoration:none;

}

.changebordercolor {

border-top:1px solid #369;

border-left:1px solid #369;

}

.backbordercolor {

border:0px solid red;

}

</style>

<script language="javascript">

function msg(){

document.getElementById("msg1").style.display="none"

document.getElementById("msg2").style.display="none"

}

function msgnone(ms,cont){

document.getElementById(ms).style.display='block'

document.getElementById(cont).style.display='none'

}

function aa1(){

document.getElementById("content1").style.display="block"

document.getElementById("content2").style.display="none"

document.getElementById("content3").style.display="none"

document.getElementById("content4").style.display="none"

document.getElementById("content5").style.display="none"

document.getElementById("content6").style.display="none"

}

function aa2(){

document.getElementById("content1").style.display="none"

document.getElementById("content2").style.display="block"

document.getElementById("content3").style.display="none"

document.getElementById("content4").style.display="none"

document.getElementById("content5").style.display="none"

document.getElementById("content6").style.display="none"

}

function aa3(){

document.getElementById("content1").style.display="none"

document.getElementById("content2").style.display="none"

document.getElementById("content3").style.display="block"

document.getElementById("content4").style.display="none"

document.getElementById("content5").style.display="none"

document.getElementById("content6").style.display="none"

}

function aa4(){

document.getElementById("content1").style.display="none"

document.getElementById("content2").style.display="none"

document.getElementById("content3").style.display="none"

document.getElementById("content4").style.display="block"

document.getElementById("content5").style.display="none"

document.getElementById("content6").style.display="none"

}

function aa5(){

document.getElementById("content1").style.display="none"

document.getElementById("content2").style.display="none"

document.getElementById("content3").style.display="none"

document.getElementById("content4").style.display="none"

document.getElementById("content5").style.display="block"

document.getElementById("content6").style.display="none"

}

function aa6(){

document.getElementById("content1").style.display="none"

document.getElementById("content2").style.display="none"

document.getElementById("content3").style.display="none"

document.getElementById("content4").style.display="none"

document.getElementById("content5").style.display="none"

document.getElementById("content6").style.display="block"

}

</script>

<body onLoad="aa1();msg()">

<div id="divall">

<div id="title">分类类型</div>

<div id="table1">

<table cellpadding=0 cellspacing=0 boder=0>

<tr align=center>

<td onMouseOver="this.bgColor='#33ccff';aa1();msg();this.className='changebordercolor'"

onMouseOut="this.bgColor='#7DA7D9';this.className='backbordercolor'"><a

href="http://www.baidu.com">游戏下载</a></td>

<td onMouseOver="this.bgColor='#33ccff';aa2();msg();this.className='changebordercolor'"

onMouseOut="this.bgColor='#7DA7D9';this.className='backbordercolor'"><a

href="http://www.baidu.com">游戏下载</a></td>

<td onMouseOver="this.bgColor='#33ccff';aa3();msg();this.className='changebordercolor'"

onMouseOut="this.bgColor='#7DA7D9';this.className='backbordercolor'"><a

href="http://www.baidu.com">游戏下载</a></td>

</tr></table></div>

<div id="content1">{dy}个里面的内容<div onClick="msgnone('msg1','content1')">关闭</div></div>

<div id="content2">第二个里面的内容<div onClick="msgnone('msg1','content2')">关闭</div></div>

<div id="content3">第三个里面的内容<div onClick="msgnone('msg1','content3')">关闭</div></div>

<div id="msg1">没有选择类型</div>

<div id="table2">

<table cellpadding=0 cellspacing=0 boder=0>

<tr align=center>

<td onMouseOver="this.bgColor='#33ccff';aa4();msg();this.className='changebordercolor'"

onMouseOut="this.bgColor='#7DA7D9';this.className='backbordercolor'"><a

href="http://www.baidu.com">游戏下载</a></td>

<td onMouseOver="this.bgColor='#33ccff';aa5();msg();this.className='changebordercolor'"

onMouseOut="this.bgColor='#7DA7D9';this.className='backbordercolor'"><a

href="http://www.baidu.com">游戏下载</a></td>

<td onMouseOver="this.bgColor='#33ccff';aa6();msg();this.className='changebordercolor'"

onMouseOut="this.bgColor='#7DA7D9';this.className='backbordercolor'"><a

href="http://www.baidu.com">游戏下载</a></td>

</tr></table></div>

<div id="content4">第四个里面的内容<div onClick="msgnone('msg3','content4')">关闭</div></div>

<div id="content5">第五个里面的内容<div onClick="msgnone('msg2','content5')">关闭</div></div>

<div id="content6">第六个里面的内容<div onClick="msgnone('msg2','content6')">关闭</div></div>

<div id="msg2">没有选择类型</div>

</div></body>

 

4-18网站导航文字按特殊的类型进行切换的{tx}

 

<!--[if IE]><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><![endif]-->

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

content="text/html; charset=gb2312" />

content="wuelying" />

<title>yahooo</title>

<style>

* {

margin:0;

padding:0;

font-size:12px;

}

img {

border:none;

}

ul,ol {

list-style:none;

}

#content {

margin:20px auto;

border:1px solid #a5b5c0;

width:158px;

height:241px;

background:url(http://www.webjx.com/files/071101/1_211958.gif);

overflow:hidden;

}

#title {

height:17px;

*height:16px;

background:url(http://www.webjx.com/files/071101/1_211943.gif) repeat-x;

border-bottom:1px solid #a5b5c0;

padding:3px 0 0 6px;

*padding:4px 0 0 6px;

font-weight:700;

}

#title li {

float:left;

display:inline;

width:92px;

}

#tit_l {

float:left;

width:92px;

overflow:hidden;

height:14px;

}

#tit_r {

float:right;

margin-top:-1px;

*margin-top:-2px;

}

#tit_r img {

margin-right:4px;

cursor:pointer;

}

#tit_r img:hover {

filter: Alpha(Opacity=70);

-moz-opacity: 0.7;

opacity: 0.7;

}

#text {

clear:both;

height:210px;

}

#text ul {

background:url(http://www.webjx.com/files/071101/1_212047.gif) no-repeat 12px 4px;

margin:6px 0;

}

#text li {

padding-left:34px;

line-height:21px;

}

#text li a {

color:#123b8d;

text-decoration:none;

}

#text li a:hover {

text-decoration:underline;

}

</style>

</head>

<body>

<div id="content">

<div id="title">

<div id="tit_l">

<div id="mytit">

<ul>

<li>热门搜索</li>

<li>热门体育</li>

<li>热门娱乐</li>

</ul>

</div>

</div>

<div id="tit_r"><img src="http://www.webjx.com/files/071101/1_212017.gif" alt="" /><img src="http://www.webjx.com/files/071101/1_212034.gif" alt="" /></div>

</div>

<div id="text">

<ul id="c1">

<li><a href="#">热门搜索的内容</a></li>

<li><a href="#">热门搜索的内容</a></li>

<li><a href="#">热门搜索的内容</a></li>

<li><a href="#">热门搜索的内容</a></li>

<li><a href="#">热门搜索的内容</a></li>

<li><a href="#">热门搜索的内容</a></li>

<li><a href="#">热门搜索的内容</a></li>

<li><a href="#">热门搜索的内容</a></li>

<li><a href="#">热门搜索的内容</a></li>

<li><a href="#">热门搜索的内容</a></li>

</ul>

<ul id="c2">

<li><a href="#">热门体育的内容</a></li>

<li><a href="#">热门体育的内容</a></li>

<li><a href="#">热门体育的内容</a></li>

<li><a href="#">热门体育的内容</a></li>

<li><a href="#">热门体育的内容</a></li>

<li><a href="#">热门体育的内容</a></li>

<li><a href="#">热门体育的内容</a></li>

<li><a href="#">热门体育的内容</a></li>

<li><a href="#">热门体育的内容</a></li>

<li><a href="#">热门体育的内容</a></li>

</ul>

<ul id="c3">

<li><a href="#">热门娱乐的内容</a></li>

<li><a href="#">热门娱乐的内容</a></li>

<li><a href="#">热门娱乐的内容</a></li>

<li><a href="#">热门娱乐的内容</a></li>

<li><a href="#">热门娱乐的内容</a></li>

<li><a href="#">热门娱乐的内容</a></li>

<li><a href="#">热门娱乐的内容</a></li>

<li><a href="#">热门娱乐的内容</a></li>

<li><a href="#">热门娱乐的内容</a></li>

<li><a href="#">热门娱乐的内容</a></li>

</ul>

</div>

</div>

<script type="text/javascript">

/**

*File Name:yahooo.js

*Author:wuleying

*Date:2007/10/26

**/

var myTitle = document.getElementById("mytit");

myTitle.innerHTML += myTitle.innerHTML;

var lists = myTitle.getElementsByTagName("li");

var num = lists.length - 2;

//alert(num)

myTitle.style.width = (num+1) * 92;//计算标题的总长度

var ele = document.getElementById("tit_l");

var w = ele.clientWidth;

var n = 18;

var t = 40;//数值越小,速度越快

var times = new Array(n);

var k = 0;

var l = 0;

yahooo(0);

function yahooo(s)

{

if(k >= num && s > 0)

{

ele.scrollLeft = w;

k = 1;

}

if(k < 1 && s < 0)

{

ele.scrollLeft = (num-1) * w;

k = num-1;

}

k += s;

var x = ele.scrollLeft;

var d = k * w - x;

for(i=0;i<n;i++)

(

function()

{

if(times[i]) {clearTimeout(times[i])} ;

var j = i;

times[i] = setTimeout(function(){ele.scrollLeft=x+Math.round(d*Math.sin(Math.PI*(j+1)/(2*n)));},(i+1)*t);

}

)();

}

var imgs = document.getElementById("tit_r").getElementsByTagName("img");

var c1 = document.getElementById("c1");

var c2 = document.getElementById("c2");

var c3 = document.getElementById("c3");

imgs[0].onclick = function()

{

yahooo(-1);

if(k==0){c1.style.display = "block";c2.style.display = "none";c3.style.display = "none";}

if(k==1){c1.style.display = "none";c2.style.display = "block";c3.style.display = "none";}

if(k==2){c1.style.display = "none";c2.style.display = "none";c3.style.display = "block";}

}

imgs[1].onclick = function()

{

yahooo(1);

if(k==0 || k==3){c1.style.display = "block";c2.style.display = "none";c3.style.display = "none";}

if(k==1 || k==4){c1.style.display = "none";c2.style.display = "block";c3.style.display = "none";}

if(k==2){c1.style.display = "none";c2.style.display = "none";c3.style.display = "block";}

}

</script>

</body>

</html>

 

4-19网页{tx}代码:文字变化的导航菜单(html)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">

<!-- saved from url=(0023)http://www.webjx.com/ -->

<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE></TITLE>

content="text/html; charset=utf-8">

<STYLE type=text/css>

#nav {

FONT-SIZE: 12px; LIST-STYLE-TYPE: none

}

#nav LI {

FLOAT: left; MARGIN-RIGHT: 1px

}

.bi {

POSITION: relative

}

#nav LI A {

DISPLAY: block; WIDTH: 65px; COLOR: #000000; LINE-HEIGHT: 30px; TEXT-ALIGN: center; TEXT-DECORATION: none

}

.bi SPAN {

LEFT: -999px; VISIBILITY: hidden; POSITION: absolute;

}

.bi:hover SPAN {

DISPLAY: block; WIDTH: 65px; COLOR: #000000; LINE-HEIGHT: 30px; TEXT-ALIGN: center; TEXT-DECORATION: none;

LEFT: 0px; VISIBILITY: visible; CURSOR: pointer; TOP: 0px;

BACKGROUND: #ffffff 30px 8px; COLOR: #000000; LINE-HEIGHT: 29px

}

#nav LI A:hover {

BACKGROUND: #ffffff 30px 8px; COLOR: #000000; LINE-HEIGHT: 29px

}

</STYLE>

<BODY>

<UL id=nav>

<LI><A class=bi

href="#">网页教学<SPAN>Home</SPAN></A> </LI>

<LI><A class=bi

href="#">产品购买<SPAN>Products</SPAN></A> </LI>

<LI><A class=bi

href="#">服务支持<SPAN>Services</SPAN></A>

</LI>

<LI><A class=bi

href="#">技术交流<SPAN>FAQ</SPAN></A>

</LI>

<LI><A class=bi

href="#">方案案例<SPAN>E-solution</SPAN></A>

</LI>

<LI><A class=bi

href="#">关于京成<SPAN>About</SPAN></A> </LI>

<LI><A class=bi

href="#">联系我们<SPAN>Contact

Us</SPAN></A> </LI>

<LI><A class=bi

href="#">加入我们<SPAN>Join</SPAN></A>

</LI>

<LI><A class=bi

href="#">下载支持<SPAN>Download</SPAN></A>

</LI></UL></BODY></HTML>

郑重声明:资讯 【[网网秀]Javascript代码碎片四(导航{tx}) - 无边尘事皆忘却,只有雪花满 ...】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——