📄 08c.htm
字号:
<html>
<head>
<title>跟随鼠标的图形</title>
<meta http-equiv="目录类型" content="文本/html; 字符集=gb2312">
<style type="text/css">
<!--
a{font-style:normal;text-decoration:none;color:white}
a:hover {BACKGROUND:red;font-style:normal;text-decoration:none;color:yellow}
a:active {font-style:normal;text-decoration:none;color:yellow;}
.white { color: #FFFFFF}
table { font-size: 9pt}
-->
</style>
<link rel="stylesheet" href="style.css">
</head>
<body bgcolor="#009900" topmargin="0" leftmargin="0">
<form name="form">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#009900">
<td colspan="3" height="18"> </td>
</tr>
<tr>
<td bgcolor="#009900" width="18"></td>
<td align="center" bgcolor="#FFFFFF"> <br>
<table width="56%" border="0" cellspacing="0" cellpadding="0" height="355">
<tr>
<td rowspan="2" width="16" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="white" style="FONT-SIZE: 11pt;">
<tr bgcolor="#336699" bordercolor="#336699">
<td style="BORDER-RIGHT: double; BORDER-TOP: double; BORDER-LEFT: double; BORDER-BOTTOM: double;" height="70"><strong><a href="08.htm">演<br>
<br>
示</a></strong></td>
</tr>
<tr bordercolor="#009900" bgcolor="#009900">
<td style="BORDER-RIGHT: double; BORDER-TOP: double; BORDER-LEFT: double; BORDER-BOTTOM: double" height="70"><strong><a href="08c.htm">源<br>
代<br>
码</a></strong></td>
</tr>
</table>
</td>
<td rowspan="2" width="8" bgcolor="#009900"> </td>
<td align="center" style="BORDER-RIGHT: double; BORDER-TOP: double; FONT-SIZE: 12pt; BORDER-LEFT: double; BORDER-BOTTOM: double" bordercolor="#009900" valign="top">
<script language="JavaScript">
<!--hide
function CodeOut(form){
var
txt=""+form.a.value+""+form.b.value+""+form.c.value+"";
form.Code.value=txt;
}
<!-->
</script>
<div id="Layer1" style="position:absolute; width:207px; height:173px; z-index:1; visibility: hidden">
<textarea name="a" cols="40" rows="0" wrap="VIRTUAL"><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>
<script language="javascript">
if (navigator.appName == "Netscape") {
}
else
{
document.write('<div ID=OuterDiv>')
document.write('<img ID=iit src="</textarea>
<textarea name="c" cols="40" rows="0" wrap="VIRTUAL">" STYLE="position:absolute;TOP:0pt;LEFT:0pt;Z-INDEX:2;visibility:hidden;">')
document.write('</div>')
}
</script></textarea>
</div>
<br>
<b>跟随鼠标的图形</b>
<hr width="92%" size="1" align="center">
<table cellspacing="0" cellpadding="0" width="81%">
<tr>
<td colspan="2" height="30">图形文件名:
<input type=text name="b" onFocus="this.select()" onMouseOver="this.focus()" class="pt9" size="35">
</td>
</tr>
<tr>
<td colspan="2" align="center" height="30">
<input type="button" value="产生源代码" onClick="CodeOut(this.form);" name="button">
</td>
</tr>
<tr>
<td height="23" colspan="2">注释:放在<body>与</body>之间</td>
</tr>
<tr>
<td colspan="2">
<textarea name="Code" onFocus="this.select()" onMouseOver="this.focus()" cols="50" rows="12" wrap="VIRTUAL" style="BACKGROUND-COLOR: #009900;" class="pt9"></textarea>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="20" class="white" bgcolor="#009900">当前位置:<a href="../../index.htm">首
页</a>→<a href="../index.htm">JavaScript</a>→<a href="index.htm#8">鼠标动作</a>→跟随鼠标的图形</td>
</tr>
</table>
<br>
</td>
<td bgcolor="#009900" width="18"></td>
</tr>
<tr bgcolor="#009900">
<td></td>
<td align="center" height="35"> <font color="#FFFFFF">··无忧网络 设计发布··</font>
</td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -