首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

要个导航栏的代码

2012-02-23 
求助:要个导航栏的代码要求:导航栏每个按纽都用背景图片修饰,当鼠标经过是显示其他背景图片。谢谢各位[解决

求助:要个导航栏的代码
要求:导航栏每个按纽都用背景图片修饰,当鼠标经过是显示其他背景图片。谢谢各位

[解决办法]

HTML code
 <HTML> 
<HEAD>
<TITLE>top </TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i <a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i <a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i <d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i <d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i <(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
.STYLE1 {color: #FF00FF}
.STYLE2 {font-size: 12px}
-->
</style>
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onLoad="MM_preloadImages('images/head1_2.gif','images/head1_3.gif','images/head1_4.gif','images/head1_5.gif','images/head1_6.gif','images/head1_7.gif','images/head1_8.gif','images/head1_9.gif','images/head1_10.gif','images/head1_11.gif')">
<!-- ImageReady Slices (首页 改版.psd) -->
<TABLE WIDTH=777 BORDER=0 align=center CELLPADDING=0 CELLSPACING=0 >
<TR>
<TD height="131" COLSPAN=10 align="right" valign="middle" background="images/index_02.gif"> <table width="288" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="159" height="28">&nbsp; </td>
      <td width="95"> <span class="STYLE2">[ <span class="STYLE1" style="CURSOR: hand" onClick="var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.flvsh.com');">设为首页 </span>] </span> </td>
      <td width="34">&nbsp; </td>
    </tr>
    <tr>
      <td height="22">&nbsp; </td>
      <td> <span class="STYLE2">[ <span class="STYLE1" style="CURSOR: hand" title="蓝波湾—贵州IT技术专区" onClick="window.external.addFavorite('http://www.flvsh.com','蓝波湾—贵州IT技术专区')">收藏本站 </span>] </span> </td>
      <td>&nbsp; </td>
    </tr>
    <tr>
      <td height="31">&nbsp; </td>


      <td> <span class="STYLE2">[ <span class="STYLE1">联系我们 </span>] </span> </td>
      <td>&nbsp; </td>
    </tr>
    </table> </TD>
</TR>
<TR> <TD width="58" height="36"> <a href="index.asp"  onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image288','','images/index2_04.gif',1)"> <IMG SRC="images/index_04.gif" WIDTH=58 HEIGHT=36  name="image288" ALT="" border="0"> </a> </TD>
<TD width="105"> <a href="news/new_list.asp"  onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image289','','images/index2_05.gif',1)"> <IMG SRC="images/index_05.gif" WIDTH=105 HEIGHT=36  name="image289" ALT=""  border="0"> </a> </TD>
<TD width="100"> <a href="news/new_list.asp?jy_type=15"  onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image290','','images/index2_06.gif',1)"> <IMG SRC="images/index_06.gif" WIDTH=100 HEIGHT=36  name="image290" ALT="" border="0"> </a> </TD>
<TD width="86"> <a href="news/new_list.asp?jy_type=4" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image291','','images/index2_07.gif',1)"> <IMG SRC="images/index_07.gif" WIDTH=86 HEIGHT=36  name="image291" ALT="" border="0"> </a> </TD>
<TD width="103"> <a href="news/music_list.asp"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image292','','images/index2_08.gif',1)"> <IMG SRC="images/index_08.gif" WIDTH=103 HEIGHT=36  name="image292" ALT="" border="0"> </a> </TD>
<TD width="65"> <a href="news/downloads_list.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image293','','images/index2_09.gif',1)"> <IMG SRC="images/index_09.gif" WIDTH=65 HEIGHT=36  name="image293" ALT="" border="0"> </a> </TD>
<TD width="100"> <a href="news/new_list.asp?jy_type=3"  onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image294','','images/index2_10.gif',1)"> <img src="images/index_10.gif" width=100 height=36  name="image294" alt="" border="0"> </a> </TD>
<TD width="95"> <a href="news/asp_list.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image295','','images/index2_11.gif',1)"> <IMG SRC="images/index_11.gif" WIDTH=95 HEIGHT=36  name="image295" ALT="" border="0"> </a> </TD>
<TD width="65"> <a href="news/contract.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image296','','images/index2_12.gif',1)"> <IMG SRC="images/index_12.gif" WIDTH=65 HEIGHT=36  name="image296" ALT="" border="0"> </a> </TD>
</TR>
</TABLE>
<!-- End ImageReady Slices -->
</BODY>
</HTML>


[解决办法]
DW里就有这功能,不用自己写。那个选项叫“鼠标经过图像”

热点排行
Bad Request.