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

📄 a0009.htm

📁 JavaScript源代码全集
💻 HTM
字号:
<!--Saved  from《天索星网》http://www.tasoo.2000c.net,E-mail:tasoo_cn@yahoo.com.cn-->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<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>《网络教程》之Javascript--一个很有趣的按钮</title>
<script>

var fs=1

var direction="right"

function rollertext(whichone){

	document.write("<BODY bgcolor='WHITE' vlink='yellow' alink='Red'>");
	document.writeln("<font color='red' face='arial' size='3'><DIV align='center'>");

	var thetext=whichone
	
	for (i=0;i<thetext.length;i++){
	
	document.writeln(thetext.charAt(i).fontsize(fs))
	
	
	if (fs<7&&direction=="right")
	
	fs++
	
	else if (fs==7){
	
	direction="left"
	
	fs--
	
	}
	
	else if (fs==1){
	
	direction="right"
	
	fs++
	
	}
	
	else if (fs>1&&direction=="left")
	
	fs--


}

	document.writeln("</DIV>")
}

</script>
</head>

<body topmargin="0" leftmargin="0">
<div align="center"><center>

<table border="0" width="90%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" colspan="2" height="62"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="250"><img src="../photo/jx.gif" border="0" WIDTH="200" HEIGHT="80"></td>
        <td width="468" height="60"></td>
      </tr>
    </table>
    </center></div></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#C8C882" valign="middle" align="center" height="22"></td>
    <td width="80%" bgcolor="#C8C882" valign="middle" align="center" height="22"><strong><span style="font-size: 10pt; font-family: Arial">javascript 按钮类</span></strong></td>
  </tr>
  <tr>
    <td width="20%" valign="top" align="left"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">时间类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">文字类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">导航类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">鼠标类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">按钮类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">跑马灯</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm"><font face="Arial"><strong>COOKIE</strong></font>类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">其他类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="10" bgcolor="#505028"></td>
      </tr>
    </table>
    </center></div></td>
    <td width="80%" valign="top" align="left"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" bgcolor="#EBEBEB" valign="middle" align="center" height="18">一个很有趣的按钮</td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="2"><input type="button" value="点我一下看看!" name onClick="rollertext('Welcome to tasoosatrnet!')" style="background-color: rgb(0,80,170); color: rgb(255,255,0)"></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="1"><div align="center"><center><table border="0" width="100%" bgcolor="#000080" height="1" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100%"></td>
          </tr>
        </table>
        </center></div><div align="center"><center><table border="0" width="80%" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100%" bgcolor="#F0FAFF" valign="bottom" align="center" height="25"><span style="font-size: 9pt; color: rgb(255,0,0)">拷贝下面的代码到你的html文件的&lt;body&gt;和&lt;/body&gt;之间</span></td>
          </tr>
          <tr>
            <td width="100%" valign="middle" align="center" bgcolor="#F0FAFF"><form name="copy">
              <p><textarea rows="6" name="S1" cols="40" onMouseOver="this.focus()" onFocus="this.select()">&lt;script&gt;

var fs=1

var direction=&quot;right&quot;

function rollertext(whichone){

	document.write(&quot;&lt;BODY bgcolor='WHITE' vlink='yellow' alink='Red'&gt;&quot;);
	document.writeln(&quot;&lt;font color='red' face='arial' size='3'&gt;&lt;DIV align='center'&gt;&quot;);

	var thetext=whichone
	
	for (i=0;i&lt;thetext.length;i++){
	
	document.writeln(thetext.charAt(i).fontsize(fs))
	
	
	if (fs&lt;7&amp;&amp;direction==&quot;right&quot;)
	
	fs++
	
	else if (fs==7){
	
	direction=&quot;left&quot;
	
	fs--
	
	}
	
	else if (fs==1){
	
	direction=&quot;right&quot;
	
	fs++
	
	}
	
	else if (fs&gt;1&amp;&amp;direction==&quot;left&quot;)
	
	fs--


}

	document.writeln(&quot;&lt;/DIV&gt;&quot;)
}

&lt;/script&gt;
</textarea></p>
            </form>
            </td>
          </tr>
          <tr>
            <td width="100%" valign="middle" align="center" bgcolor="#F0FAFF"><span style="font-size: 9pt; color: rgb(255,0,0)">拷贝下面的代码到你的html文件的&lt;body&gt;和&lt;/body&gt;之间</span></td>
          </tr>
          <tr>
            <td width="100%" bgcolor="#F0FAFF">&lt;input type=&quot;button&quot;<br>
            value=&quot;点我一下看看!&quot; name onClick=&quot;rollertext('Welcome to 
            tasoosatrnet!')&quot;<br>
            style=&quot;background-color: rgb(0,80,170); color: rgb(255,255,0)&quot;&gt;</td>
          </tr>
        </table>
        </center></div><p> </td>
      </tr>
    </table>
    </center></div></td>
  </tr>
</table>
</center></div><div align="center"><center>

<table width="90%" cellspacing="0" cellpadding="0" height="130">
  <tr>
    <td width="148" valign="middle" align="center" height="18"></td>
    <td width="60%" valign="middle" align="center" height="18"></td>
    <td width="20%" valign="middle" align="center" height="18"></td>
  </tr>
  <tr>
    <td width="148" bgcolor="#FFFFFF" valign="middle" align="center" height="20"></td>
    <td width="60%" height="20"></td>
    <td width="20%" height="20"></td>
  </tr>
  <tr>
    <td width="148" bgcolor="#FFFFFF" valign="middle" align="center" height="17"></td>
    <td width="60%" height="17"><p align="center"><span style="font-size: 9pt"><a href="a0008.htm">上一页</a> &nbsp;&nbsp;&nbsp; 下一页</span></td>
    <td width="20%" height="17"></td>
  </tr>
  <tr>
    <td width="148" bgcolor="#FFFFFF" valign="middle" align="center" height="14"></td>
    <td width="60%" height="14"></td>
    <td width="20%" height="14"></td>
  </tr>
  <tr>
    <td width="148" bgcolor="#FFFFFF" valign="middle" align="center" height="14"></td>
    <td width="60%" height="14"></td>
    <td width="20%" height="14"></td>
  </tr>
  <tr>
    <td width="148" bgcolor="#FFFFFF" valign="middle" align="center" height="47"></td>
    <td width="60%" height="47"><div align="center"><center><table cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%"><p align="center"><font color="#969696"><span style="font-size: 9pt">《天索星网》 
        星网制作 版权所有</span></font></td>
      </tr>
      <tr>
        <td width="100%"><p align="center"><font color="#969696"><span style="font-size: 9pt; font-family: Arial">&copy;2000-2001 All Rights Reserved</span></font></td>
      </tr>
      <tr>
        <td width="100%"></td>
      </tr>
    </table>
    </center></div></td>
    <td width="20%" height="47"></td>
  </tr>
</table>
</center></div>
</body>
</html>
<!--Saved  from天索星网  版权所有;http://www.tasoo.2000c.net,E-mail:tasoo_cn@yahoo.com.cn-->

⌨️ 快捷键说明

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