⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 js63.htm

📁 搜集的很多javascript实例及教程
💻 HTM
字号:
<!--Saved  from《网页设计师》pageone.yeah.net,作者:阿捷ajie@nease.net-->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="Javascript,Javascript,Javascript,Javascript,Javascript">
<!--  以下代码是设定此页的超链接样式    -->
<style type="text/css"><!-- A:link {text-decoration: none; color:#000000}
     A:visited {text-decoration: none; color: #000000}
     A:active {text-decoration: none; color: #FF0000}
     A:hover {text-decoration: underline; color: FF0000}
       body{font-size=9pt}
	        TH{FONT-SIZE: 9pt}
           TD{ FONT-SIZE: 9pt}
       -->
</style>
<title>超级滚动公告板</title>
</head>

<body bgcolor="#FFFFFF">

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%" bgcolor="#006DA2"><map name="FPMap0">
      <area href="http://www.pageone.yeah.net" shape="rect" coords="8, 2, 105, 34"></map><img src="../images/jlogo3.GIF" alt="网页设计师" border="0" usemap="#FPMap0" width="111" height="36"></td>
    <td width="50%" bgcolor="#006DA2"><p align="right"><br>
      <a href="js61.htm">
    上一页</a> <a href="js66.htm">下一页</a> <a href="../index.html">返回首页</a></td>
  </tr>
</table>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="5%" bgcolor="#B7D1F4" valign="top"></td>
    <td width="16%" bgcolor="#006DA2" valign="top"><table border="0" width="100%" cellspacing="4" cellpadding="0">
      <tr>
        <td width="16%"></td>
        <td width="84%"></td>
      </tr>
      <tr>
        <td width="16%"><font color="#ffff80">★</font></td>
        <td width="84%"><font face="Arial"><a href="index.htm">JAVASCRIPT</a></font></td>
      </tr>
      <tr>
        <td width="16%"><font color="#ffff80">★</font></td>
        <td width="84%"><font face="Arial"><a href="../frontpage/index.htm">FRONTPAGE</a></font></td>
      </tr>
      <tr>
        <td width="16%"><font color="#ffff80">★</font></td>
        <td width="84%"><font face="Arial"><a href="../dhtml/index.htm">DHTML</a></font></td>
      </tr>
      <tr>
        <td width="16%"><font color="#ffff80">★</font></td>
        <td width="84%"><font face="Arial"><a href="../photoshop/index.htm">PHOTOSHOP</a></font></td>
      </tr>
      <tr>
        <td width="16%"><font color="#ffff80">★</font></td>
        <td width="84%"><font face="Arial"><a href="../fireworks/index.htm">FIREWORKS</a></font></td>
      </tr>
      <tr>
        <td width="16%"><font color="#ffff80">★</font></td>
        <td width="84%"><font face="Arial"><a href="../flash/index.htm">FLASH</a></font></td>
      </tr>
      <tr>
        <td width="16%"><font color="#ffff80">★</font></td>
        <td width="84%"><font face="Arial"><a href="../cgi/index.htm">CGI</a></font></td>
      </tr>
      <tr>
        <td width="16%" a><font color="#ffff80">★</font></td>
        <td width="84%"><font face="Arial"><a href="../download/index.htm">DOWNLOAD</a></font></td>
      </tr>
      <tr>
        <td width="16%"></td>
        <td width="84%"></td>
      </tr>
    </table>
    </td>
    <td width="79%" valign="top"><table border="0" width="100%" cellspacing="1" cellpadding="0">
      <tr>
        <td width="12%" bgcolor="#B7D1F4"><p align="center"><font color="#FF8000">名称</font></td>
        <td width="88%" bgcolor="#FFFFFF"><p align="center">超级滚动公告板</td>
      </tr>
      <tr>
        <td width="12%" bgcolor="#B7D1F4" valign="top"><p align="center"><font color="#FF8000">实例</font></td>
        <td width="88%"><table border="1" width="100%" bordercolor="#B7D1F4" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100%"><p align="center"><script language="JavaScript1.2">

//设置下面的三行参数,分别是宽度、高度和背景色。
var scrollerwidth=150
var scrollerheight=60
var scrollerbgcolor='white'

//下面设置显示的文字内容,可以使用标准的HTML语法。
var messages=new Array()
messages[0]="<a href='../index.html'>点这里回首页,欢迎你访问阿捷的《网页设计师》</a>"
messages[1]="<a href='../download/index.htm'>点这里去下载中心,你可以到那里下载本站各个栏目的压缩包</a>"
messages[2]="<a href='../tip/index.htm'>点这里去心得技巧栏目,这里搜集了网页制作高手们的心得文章</a>"
messages[3]="<a href='../search/index.htm'>点这里去本站搜索,快速检索本站内容</a>"
messages[4]="<a href='../connect.htm'>点这里联系阿捷,有任何意见建议请来信。</a>"

//下面的代码不要改动

if (messages.length>1)
i=2
else
i=0

function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0
setTimeout("move1(tlayer)",3000)
setTimeout("move2(document.main.document.second)",3000)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5
setTimeout("move1(tlayer)",100)
}
else{
tlayer.top=scrollerheight
tlayer.document.write(messages[i])
tlayer.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}

function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0
setTimeout("move2(tlayer2)",3000)
setTimeout("move1(document.main.document.first)",3000)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5
setTimeout("move2(tlayer2)",100)
}
else{
tlayer2.top=scrollerheight
tlayer2.document.write(messages[i])
tlayer2.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}

function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",3000)
setTimeout("move4(second2)",3000)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=5
setTimeout("move3(tdiv)",100)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}

function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",3000)
setTimeout("move3(first2)",3000)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=5
setTimeout("move4(second2)",100)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}

function startscroll(){
if (document.all){
move3(first2)
second2.style.top=scrollerheight
}
else if (document.layers){
move1(document.main.document.first)
document.main.document.second.top=scrollerheight+5
document.main.document.second.visibility='show'
}
}

window.onload=startscroll

</script>
      <ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight}; bgcolor=&{scrollerbgcolor};> 
      <layer id="first" left=0 top=1 width=&{scrollerwidth};> 
      <script language="JavaScript1.2">
if (document.layers)
document.write(messages[0])
</script>
      </layer>
      <layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide> 
      <script language="JavaScript1.2">
if (document.layers)
document.write(messages[1])
</script>
      </layer>
      </ilayer>
      <script language="JavaScript1.2">
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')
document.write(messages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0">')
document.write(messages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')
}
</script>
            <p> 
            </td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td width="12%" bgcolor="#B7D1F4" valign="top"><p align="center"><font color="#FF8000">教程</font></td>
        <td width="88%"><table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#B7D1F4">
          <tr>
            <td width="100%" bgcolor="#FFFFFF"><br>
              <p>第一步:拷贝下面的代码到你的html文件的&lt;body&gt;和&lt;/body&gt;之间;</p>
            <blockquote>
              <form name="copy1">
                <p><textarea rows="8" name="S1" cols="45" onMouseOver="this.focus()" onFocus="this.select()"><script language="JavaScript1.2">

//设置下面的三行参数,分别是宽度、高度和背景色。
var scrollerwidth=150
var scrollerheight=60
var scrollerbgcolor='white'

//下面设置显示的文字内容,可以使用标准的HTML语法。
var messages=new Array()
messages[0]="<a href='../index.html'>点这里回首页,欢迎你访问阿捷的《网页设计师》</a>"
messages[1]="<a href='../download/index.htm'>点这里去下载中心,你可以到那里下载本站各个栏目的压缩包</a>"
messages[2]="<a href='../tip/index.htm'>点这里去心得技巧栏目,这里搜集了网页制作高手们的心得文章</a>"
messages[3]="<a href='../search/index.htm'>点这里去本站搜索,快速检索本站内容</a>"
messages[4]="<a href='../connect.htm'>点这里联系阿捷,有任何意见建议请来信。</a>"

//下面的代码不要改动

if (messages.length>1)
i=2
else
i=0

function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0
setTimeout("move1(tlayer)",3000)
setTimeout("move2(document.main.document.second)",3000)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5
setTimeout("move1(tlayer)",100)
}
else{
tlayer.top=scrollerheight
tlayer.document.write(messages[i])
tlayer.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}

function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0
setTimeout("move2(tlayer2)",3000)
setTimeout("move1(document.main.document.first)",3000)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5
setTimeout("move2(tlayer2)",100)
}
else{
tlayer2.top=scrollerheight
tlayer2.document.write(messages[i])
tlayer2.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}

function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",3000)
setTimeout("move4(second2)",3000)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=5
setTimeout("move3(tdiv)",100)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}

function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",3000)
setTimeout("move3(first2)",3000)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=5
setTimeout("move4(second2)",100)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}

function startscroll(){
if (document.all){
move3(first2)
second2.style.top=scrollerheight
}
else if (document.layers){
move1(document.main.document.first)
document.main.document.second.top=scrollerheight+5
document.main.document.second.visibility='show'
}
}

window.onload=startscroll

</script>
      <ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight}; bgcolor=&{scrollerbgcolor};> 
      <layer id="first" left=0 top=1 width=&{scrollerwidth};> 
      <script language="JavaScript1.2">
if (document.layers)
document.write(messages[0])
</script>
      </layer>
      <layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide> 
      <script language="JavaScript1.2">
if (document.layers)
document.write(messages[1])
</script>
      </layer>
      </ilayer>
      <script language="JavaScript1.2">
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')
document.write(messages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0">')
document.write(messages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')
}
</script>
</textarea></p>
              </form>
            </blockquote>
            <p>说明:具体参数在原代码里有详细说明</p>
            <p> </td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td width="12%" bgcolor="#B7D1F4" valign="top"><p align="center"><font color="#FF8000">下载</font></td>
        <td width="88%" bgcolor="#FFFFFF"> 请到<a href="../download/index.htm">下载中心</a></td>
      </tr>
      <tr>
        <td width="12%" bgcolor="#B7D1F4" valign="top"><p align="center"><font color="#FF8000">版权</font></td>
        <td width="88%" bgcolor="#FFFFFF"> 本站合作站点《<a href="http://java2000.wol.com.cn/index.html" target="_blank">java2000</a>》友情提供</td>
      </tr>
    </table>
    </td>
  </tr>
</table>

<table border="0" width="100%" cellspacing="0" cellpadding="0" height="39">
  <tr>
    <td width="21%" bgcolor="#006DA2" height="25"><font color="#0072A8">.</font></td>
    <td width="79%" bgcolor="#E6F2FF" height="25" colspan="2"><p align="right"><br>
      <a href="js61.htm">
    上一页</a> <a href="js66.htm">下一页</a> <a href="#top">回到页首</a></td>
  </tr>
  <tr>
    <td width="21%" height="3"></td>
    <td width="79%" height="3" align="center" colspan="2"><font color="#FFFFFF">.</font></td>
  </tr>
  <tr>
    <td width="21%" height="2"></td>
    <td width="27%" height="7" align="center" rowspan="2"><p align="right"><img src="../images/jlogo4.GIF" alt="jlogo4.GIF (1066 bytes)" WIDTH="26" HEIGHT="26"></td>
    <td width="52%" height="2">《<a href="http://pageone.yeah.net">网页设计师</a>》  
    阿捷制作 版权所有</td> 
  </tr> 
  <tr> 
    <td width="21%" height="5"></td> 
    <td width="52%" height="5"><font face="Arial">&copy;1999-2000</font> <font face="Arial">All  
    Rights Reserved</font></td> 
  </tr> 
  <tr> 
    <td width="21%" height="4"></td> 
    <td width="79%" height="4" align="center" colspan="2">本站教程免费学习,引用请注明出处,禁止抄袭。</td> 
  </tr> 
</table> 
</body> 
</html> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -