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

📄 b0003.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 LANGUAGE="JavaScript">
	var newtop=0
	var newleft=0
	if (navigator.appName == "Netscape") {
		layerStyleRef="layer.";
		layerRef="document.layers";
		styleSwitch="";
		}
		else
		{
		layerStyleRef="layer.style.";
		layerRef="document.all";
		styleSwitch=".style";
		}

	function doMouseMove() {

		layerName = 'iit'

		eval('var curElement='+layerRef+'["'+layerName+'"]')
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"')
		eval('curElement'+styleSwitch+'.visibility="visible"')
		eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
		eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')
		eval('height=curElement'+styleSwitch+'.height')
		eval('width=curElement'+styleSwitch+'.width')
		width=parseInt(width)
		height=parseInt(height)
		if (event.clientX > (document.body.clientWidth - 5 - width))
		{
		newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width
		}
		else
		{
		newleft=document.body.scrollLeft + event.clientX
		}
		eval('curElement'+styleSwitch+'.pixelLeft=newleft')

		if (event.clientY > (document.body.clientHeight - 5 - height))
		{
		newtop=document.body.clientHeight + document.body.scrollTop - 5 - height
		}
		else
		{
		newtop=document.body.scrollTop + event.clientY
		}
		eval('curElement'+styleSwitch+'.pixelTop=newtop')
}

	document.onmousemove = doMouseMove;

</script>
</head>

<body topmargin="0" leftmargin="0">
<script language="javascript">
	if (navigator.appName == "Netscape") {

	}
	else
	{
		document.write('<div ID=OuterDiv>')
		document.write('<img ID=iit src="butt.gif" STYLE="position:absolute;TOP:0pt;LEFT:0pt;width=37;height=34;Z-INDEX:2;visibility:hidden;">')
		document.write('</div>')
	}
</script>
<div align="center"><center>

<table border="0" width="90%" cellspacing="0" cellpadding="0" height="633">
  <tr>
    <td width="100%" colspan="3" 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" colspan="2" height="22"><strong><span style="font-size: 10pt; font-family: Arial">javascript 鼠标类</span></strong></td>
  </tr>
  <tr>
    <td width="20%" valign="top" align="left" height="242"><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"><a href="index.htm"><span style="font-size: 9pt">时间类</span></a></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><a href="index.htm"><span style="font-size: 9pt">文字类</span></a></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><a href="index.htm"><span style="font-size: 9pt">导航类</span></a></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><a href="index.htm"><span style="font-size: 9pt">鼠标类</span></a></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><a href="index.htm"><span style="font-size: 9pt">按钮类</span></a></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><a href="index.htm"><span style="font-size: 9pt">跑马灯</span></a></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><a href="index.htm"><span style="font-size: 9pt"><font face="Arial"><strong>COOKIE</strong></font>类</span></a></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><a href="index.htm"><span style="font-size: 9pt">其他类</span></a></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" colspan="2" height="242"><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" colspan="3">随鼠标移动的图片</td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="2" colspan="3"></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="1" colspan="3" bgcolor="#000080"></td>
      </tr>
      <tr>
        <td width="16%" valign="middle" align="center" height="22"></td>
        <td width="67%" valign="middle" align="center" height="22"></td>
        <td width="17%" valign="middle" align="center" height="22"></td>
      </tr>
      <tr>
        <td width="16%" valign="middle" align="center" height="20"></td>
        <td width="67%" valign="middle" align="center" height="20"></td>
        <td width="17%" valign="middle" align="center" height="20"></td>
      </tr>
      <tr>
        <td width="16%" valign="middle" align="center" height="22" rowspan="5"></td>
        <td width="67%" valign="middle" align="left" height="5" bgcolor="#F0FAFF"><span style="font-size: 9pt; color: rgb(255,0,0)">第一步:拷贝下面的代码到你的html文件的&lt;head&gt;和&lt;/head&gt;之间</span></td>
        <td width="17%" valign="middle" align="center" height="22" rowspan="5"></td>
      </tr>
      <tr>
        <td width="67%" valign="middle" align="center" height="5" bgcolor="#F0FAFF"><form name="copy">
          <p><textarea rows="6" name="S1" cols="40" onMouseOver="this.focus()" onFocus="this.select()">&lt;script LANGUAGE=&quot;JavaScript&quot;&gt;
	var newtop=0
	var newleft=0
	if (navigator.appName == &quot;Netscape&quot;) {
		layerStyleRef=&quot;layer.&quot;;
		layerRef=&quot;document.layers&quot;;
		styleSwitch=&quot;&quot;;
		}
		else
		{
		layerStyleRef=&quot;layer.style.&quot;;
		layerRef=&quot;document.all&quot;;
		styleSwitch=&quot;.style&quot;;
		}

	function doMouseMove() {

		layerName = 'iit'

		eval('var curElement='+layerRef+'[&quot;'+layerName+'&quot;]')
		eval(layerRef+'[&quot;'+layerName+'&quot;]'+styleSwitch+'.visibility=&quot;hidden&quot;')
		eval('curElement'+styleSwitch+'.visibility=&quot;visible&quot;')
		eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
		eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')
		eval('height=curElement'+styleSwitch+'.height')
		eval('width=curElement'+styleSwitch+'.width')
		width=parseInt(width)
		height=parseInt(height)
		if (event.clientX &gt; (document.body.clientWidth - 5 - width))
		{
		newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width
		}
		else
		{
		newleft=document.body.scrollLeft + event.clientX
		}
		eval('curElement'+styleSwitch+'.pixelLeft=newleft')

		if (event.clientY &gt; (document.body.clientHeight - 5 - height))
		{
		newtop=document.body.clientHeight + document.body.scrollTop - 5 - height
		}
		else
		{
		newtop=document.body.scrollTop + event.clientY
		}
		eval('curElement'+styleSwitch+'.pixelTop=newtop')
}

	document.onmousemove = doMouseMove;

&lt;/script&gt;
</textarea></p>
        </form>
        </td>
      </tr>
      <tr>
        <td width="67%" valign="middle" align="left" height="4" 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="67%" valign="middle" align="center" height="4" bgcolor="#F0FAFF"><form name="copy1">
          <p><textarea rows="6" name="S2" cols="40" onMouseOver="this.focus()" onFocus="this.select()">&lt;script language=&quot;javascript&quot;&gt;
	if (navigator.appName == &quot;Netscape&quot;) {

	}
	else
	{
		document.write('&lt;div ID=OuterDiv&gt;')
		document.write('&lt;img ID=iit src=&quot;butt.gif&quot; STYLE=&quot;position:absolute;TOP:0pt;LEFT:0pt;width=25;height=22;Z-INDEX:2;visibility:hidden;&quot;&gt;')
		document.write('&lt;/div&gt;')
	}
&lt;/script&gt;
</textarea></p>
        </form>
        </td>
      </tr>
      <tr>
        <td width="67%" valign="middle" align="left" height="4" bgcolor="#F0FAFF"></td>
      </tr>
    </table>
    </center></div></td>
  </tr>
  <tr>
    <td width="20%" 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="20%" 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="20%" bgcolor="#FFFFFF" valign="middle" align="center" height="17"></td>
    <td width="60%" height="17"><p align="center"><span style="font-size: 9pt"><a href="b0002.htm">上一页</a> &nbsp;&nbsp;&nbsp; <a href="b0004.htm">下一页</a></span></td>
    <td width="20%" height="17"></td>
  </tr>
  <tr>
    <td width="20%" 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="20%" 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="20%" 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 + -