右侧滚动菜单(MENU)代码

网络整理 - 08-30
第一种:外部调用型

一、调用JS:

QUOTE:

// JavaScript Document  <!--MENU-->
<!--

var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

function CheckUIElements()
{
    var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

    if ( bNetscape4plus ) { //哈哈
            //yButtonFrom = document["divLinkButton"].top;
            //yButtonTo   = top.pageYOffset + top.innerHeight - 55;
            yMenuFrom   = document["divMenu"].top;
            yMenuTo     = top.pageYOffset + 59;   //33
    }
    else if ( bExplorer4plus ) {  // IE33
            //yButtonFrom = parseInt (divLinkButton.style.top, 10);
            //yButtonTo   = document.body.scrollTop + document.body.clientHeight - 55;
            yMenuFrom   = parseInt (divMenu.style.top, 10);
            yMenuTo     = document.body.scrollTop + 59; //33
    }

    timeoutNextCheck = 500;

    if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
            setTimeout ("CheckUIElements()", timeoutNextCheck);
            return;
    }


    if ( yButtonFrom != yButtonTo ) {
            yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
            if ( yButtonTo < yButtonFrom )
                    yOffset = -yOffset;

            if ( bNetscape4plus )
                    document["divLinkButton"].top += yOffset;
            else if ( bExplorer4plus )
                    divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

            timeoutNextCheck = 10;
    }
    if ( yMenuFrom != yMenuTo ) {
            yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
            if ( yMenuTo < yMenuFrom )
                    yOffset = -yOffset;

            if ( bNetscape4plus )
                    document["divMenu"].top += yOffset;
            else if ( bExplorer4plus )
                    divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;

            timeoutNextCheck = 10;
    }

    setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function OnLoad_Banner()
{
    var y;

    //33
    if ( top.frames.length )
     //       top.location.href = self.location.href;

    //33
    if ( bNetscape4plus ) {
            document["divMenu"].top = top.pageYOffset + 135;
            document["divMenu"].visibility = "visible";
            //document["divLinkButton"].top = top.pageYOffset + top.innerHeight - 55;
            //document["divLinkButton"].visibility = "visible";
    }
    else if ( bExplorer4plus ) {
            divMenu.style.top = document.body.scrollTop + 135;
            divMenu.style.visibility = "visible";
            //divLinkButton.style.top = document.body.scrollTop + document.body.clientHeight - 55;
            //divLinkButton.style.visibility = "visible";
    }

    // initializing UI update timer
    CheckUIElements();
    //if ( bExplorer4plus )
    //        setTimeout ( "FlashTitleStepIt(255)", 10 );
    return true;
}

//-->


二、菜单页:

QUOTE:

<TABLE cellSpacing=0 cellPadding=0 width=35 border=0>
  <TBODY>
  <TR>
    <TD><A onfocus=this.blur()
      href="http://#"><IMG
      src="http://www.jz123.cn/Article/10/130/2006/sub_images8/top_right1204_2.gif" border=0></A></TD></TR>
  <TR>
    <TD height=2></TD></TR>
  <TR>
    <TD><A onfocus=this.blur()
      href="http://#"><IMG
      height=35 src="http://www.jz123.cn/Article/10/130/2006/sub_images8/bt_top_cp_1.gif" width=70 border=0></A></TD></TR>
  <TR>
    <TD height=3></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=70 align=center
background=sub_images8/sky_bg.gif border=0>
  <TBODY>
  <TR>
    <TD vAlign=bottom background=sub_images8/sky_top.gif height=30>
      <DIV align=right>
      <SCRIPT src="sub_images8/jsGitan_Bottom_1.htm"></SCRIPT>
      </DIV></TD></TR>
  <TR vAlign=top>
    <TD colSpan=2 height=44>
<!------------------------------------------------------------------------------------------------------------->
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR vAlign=top>
          <TD
         >
            <DIV align=center><FONT
            style="FONT-SIZE: 12px; FONT-FAMILY: dotum; TEXT-DECORATION: none"><FONT
            color=#f26522>含含糊糊</FONT></FONT></DIV></TD></TR>
        <TR>
          <TD vAlign=top>
            <DIV align=center>
            <DIV align=center><IMG height=14 src="http://www.jz123.cn/Article/10/130/2006/sub_images8/sky_ing.gif"
            width=35 border=0></DIV></DIV></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=62 align=center border=0>
        <TBODY>
        <TR>
          <TD><IMG height=1 src="http://www.jz123.cn/Article/10/130/2006/sub_images8/sky_line.gif" width=62
        vspace=3></TD></TR></TBODY></TABLE>
<!------------------------------------------------------------------------------------------------------------->
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR vAlign=top>
          <TD
         >
            <DIV align=center><FONT
            style="FONT-SIZE: 12px; FONT-FAMILY: dotum; TEXT-DECORATION: none"><FONT
            color=#f26522>含含糊糊</FONT></FONT></DIV></TD></TR>
        <TR>
          <TD vAlign=top>
            <DIV align=center>
            <DIV align=center><IMG height=14 src="http://www.jz123.cn/Article/10/130/2006/sub_images8/sky_ing.gif"
            width=35 border=0></DIV></DIV></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=62 align=center border=0>
        <TBODY>
        <TR>
          <TD><IMG height=1 src="http://www.jz123.cn/Article/10/130/2006/sub_images8/sky_line.gif" width=62
        vspace=3></TD></TR></TBODY></TABLE>
<!------------------------------------------------------------------------------------------------------------->
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR vAlign=top>
          <TD
         >
            <DIV align=center><FONT
            style="FONT-SIZE: 12px; FONT-FAMILY: dotum; TEXT-DECORATION: none"><FONT
            color=#f26522>GT-301<BR>含含糊糊</FONT></FONT></DIV></TD></TR>
        <TR>
          <TD vAlign=top>
            <DIV align=center>
            <DIV align=center><IMG height=14 src="http://www.jz123.cn/Article/10/130/2006/sub_images8/sky_ing.gif"
            width=35 border=0></DIV></DIV></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=62 align=center border=0>
        <TBODY>
        <TR>
          <TD><IMG height=1 src="http://www.jz123.cn/Article/10/130/2006/sub_images8/sky_line.gif" width=62
        vspace=3></TD></TR></TBODY></TABLE>
<!------------------------------------------------------------------------------------------------------------->
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR vAlign=top>
          <TD
         >
            <DIV align=center><FONT
            style="FONT-SIZE: 12px; FONT-FAMILY: dotum; TEXT-DECORATION: none"><FONT
            color=#f26522>含含糊糊<BR>含含糊糊</FONT></FONT></DIV></TD></TR>
        <TR>
          <TD vAlign=top>
            <DIV align=center>
            <DIV align=center><IMG height=14 src="http://www.jz123.cn/Article/10/130/2006/sub_images8/cnt_0.gif" width=35
            border=0></DIV></DIV></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=62 align=center border=0>
        <TBODY>
        <TR>
          <TD><IMG height=1 src="http://www.jz123.cn/Article/10/130/2006/sub_images8/sky_line.gif" width=62
        vspace=3></TD></TR></TBODY></TABLE>
<!------------------------------------------------------------------------------------------------------------->
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR vAlign=top>
          <TD
         >
            <DIV align=center><FONT
            style="FONT-SIZE: 12px; FONT-FAMILY: dotum; TEXT-DECORATION: none"><FONT
            color=#f26522>含含糊糊</FONT></FONT></DIV></TD></TR></TBODY></TABLE>
<!-------------------------------------------------------------------------------------------------------------></TD></TR>
  <TR>
    <TD><IMG height=7 src="http://www.jz123.cn/Article/10/130/2006/sub_images8/sky_bottom.gif"
width=70></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=35 border=0>
  <TBODY>
  <TR height=5>
    <TD></TD></TR></TBODY></TABLE>


三、插入页面代码:

QUOTE:

<!---------------------------------------滚动菜单开始------------------------------------------------------>
<SCRIPT language=JavaScript src="sub_images8/menu.js"></SCRIPT>
<DIV id=divMenu>
<IFRAME name=transFrm marginWidth=0 marginHeight=0 src="menu.htm" frameBorder=0 scrolling=no height=400></IFRAME></DIV>
<SCRIPT> OnLoad_Banner(); </SCRIPT>
<!-----------------------------------------滚动菜单结束-------------------------------------------------->


第二种:同一页面型,调用的JS为上面内容。

QUOTE:

<!----------------------------------------滚动菜单开始--------------------------------------------------------->
<SCRIPT language=JavaScript src="sub_images7/menu.js"></SCRIPT>

<DIV id=divMenu
style="LEFT: 925px; VISIBILITY: visible; WIDTH: 70px; POSITION: absolute; TOP: 59px; HEIGHT: 20px">
<TABLE cellSpacing=0 cellPadding=0 width=35 border=0>
  <TBODY>
  <TR>
    <TD><A onfocus=this.blur()
      href="http://#"><IMG
      src="http://www.jz123.cn/Article/10/130/2006/sub_images7/top_right1204_2.gif" border=0></A></TD>
  </TR>
  <TR>
    <TD height=2></TD></TR>
  <TR>
    <TD><A onfocus=this.blur()
      href="http://#"><IMG
      height=35 src="http://www.jz123.cn/Article/10/130/2006/sub_images7/bt_top_cp_1.gif" width=70 border=0></A></TD>
  </TR>
  <TR>
    <TD height=3></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=70 align=center
background=sub_images7/sky_bg.gif border=0>
  <TBODY>
  <TR>
    <TD vAlign=bottom background=sub_images7/sky_top.gif height=30>
      <DIV align=right>
      <SCRIPT src="sub_images7/jsGitan_Bottom_1.htm"></SCRIPT>
      </DIV></TD></TR>
  <TR vAlign=top>
    <TD colSpan=2 height=44>
<!------------------------------------------------------------------------------------------------------------->
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR vAlign=top>
          <TD
         >
            <DIV align=center><FONT
            style="FONT-SIZE: 12px; FONT-FAMILY: dotum; TEXT-DECORATION: none"><FONT
            color=#f26522>含含糊糊</FONT></FONT></DIV></TD></TR>
        <TR>
          <TD vAlign=top>
            <DIV align=center>
            <DIV align=center><IMG height=14 src="http://www.jz123.cn/Article/10/130/2006/sub_images7/sky_ing.gif"
            width=35 border=0></DIV></DIV></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=62 align=center border=0>
        <TBODY>
        <TR>
          <TD><IMG height=1 src="http://www.jz123.cn/Article/10/130/2006/sub_images7/sky_line.gif" width=62
        vspace=3></TD></TR></TBODY></TABLE>
<!------------------------------------------------------------------------------------------------------------->
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR vAlign=top>
          <TD
         >
            <DIV align=center><FONT
            style="FONT-SIZE: 12px; FONT-FAMILY: dotum; TEXT-DECORATION: none"><FONT
            color=#f26522>含含糊糊</FONT></FONT></DIV></TD></TR>
        <TR>
          <TD vAlign=top>
            <DIV align=center>
            <DIV align=center><IMG height=14 src="http://www.jz123.cn/Article/10/130/2006/sub_images7/sky_ing.gif"
            width=35 border=0></DIV></DIV></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=62 align=center border=0>
        <TBODY>
        <TR>
          <TD><IMG height=1 src="http://www.jz123.cn/Article/10/130/2006/sub_images7/sky_line.gif" width=62
        vspace=3></TD></TR></TBODY></TABLE>
<!------------------------------------------------------------------------------------------------------------->
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR vAlign=top>
          <TD
         >
            <DIV align=center><FONT
            style="FONT-SIZE: 12px; FONT-FAMILY: dotum; TEXT-DECORATION: none"><FONT
            color=#f26522>含含糊糊</FONT></FONT></DIV></TD></TR>
        <TR>
          <TD vAlign=top>
            <DIV align=center>
            <DIV align=center><IMG height=14 src="http://www.jz123.cn/Article/10/130/2006/sub_images7/sky_ing.gif"
            width=35 border=0></DIV></DIV></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=62 align=center border=0>
        <TBODY>
        <TR>
          <TD><IMG height=1 src="http://www.jz123.cn/Article/10/130/2006/sub_images7/sky_line.gif" width=62
        vspace=3></TD></TR></TBODY></TABLE>
<!------------------------------------------------------------------------------------------------------------->
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR vAlign=top>
          <TD
         >
            <DIV align=center><FONT
            style="FONT-SIZE: 12px; FONT-FAMILY: dotum; TEXT-DECORATION: none"><FONT
            color=#f26522>含含糊糊</FONT></FONT></DIV></TD></TR>
        <TR>
          <TD vAlign=top>
            <DIV align=center>
            <DIV align=center><IMG height=14 src="http://www.jz123.cn/Article/10/130/2006/sub_images7/cnt_0.gif" width=35
            border=0></DIV></DIV></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=62 align=center border=0>
        <TBODY>
        <TR>
          <TD><IMG height=1 src="http://www.jz123.cn/Article/10/130/2006/sub_images7/sky_line.gif" width=62
        vspace=3></TD></TR></TBODY></TABLE>
<!------------------------------------------------------------------------------------------------------------->
      <TABLE cellSpacing=0 cellPadding=0 align=center border=0>
        <TBODY>
        <TR vAlign=top>
          <TD
         >
            <DIV align=center><FONT
            style="FONT-SIZE: 12px; FONT-FAMILY: dotum; TEXT-DECORATION: none"><FONT
            color=#f26522>含含糊糊</FONT></FONT></DIV></TD></TR></TBODY></TABLE>
<!-------------------------------------------------------------------------------------------------------------></TD></TR>
  <TR>
    <TD><IMG height=7 src="http://www.jz123.cn/Article/10/130/2006/sub_images7/sky_bottom.gif"
width=70></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=35 border=0>
  <TBODY>
  <TR height=5>
    <TD></TD></TR></TBODY></TABLE></DIV>
<SCRIPT> OnLoad_Banner(); </SCRIPT>
<!-----------------------------------------滚动菜单结束--------------------------------------------------->