📄 javescripta.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0030)http://dhlyh.163.net/Jsjb1.htm -->
<HTML><HEAD><TITLE>JaveScript技巧一</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId>
<STYLE>A:link {
COLOR: #000000; FONT-FAMILY: "宋体"; TEXT-DECORATION: none
}
A:visited {
COLOR: #000000; FONT-FAMILY: "宋体"; TEXT-DECORATION: none
}
A:active {
FONT-FAMILY: "宋体"; TEXT-DECORATION: none
}
A:hover {
COLOR: #ff0000; TEXT-DECORATION: underline
}
.text1 {
FONT-FAMILY: "宋体", "Arial"; FONT-SIZE: 9pt; LINE-HEIGHT: 150%
}
</STYLE>
</HEAD>
<BODY>
<TABLE border=0 cellPadding=0 cellSpacing=0 height=41 width=762>
<TBODY>
<TR>
<TD height=11 width=176><A href="http://dhlyh.126.com/" target=_blank><IMG
alt="网狐--VFP编程 主页制作" border=0 height=60 src="JaveScripta.files/logo.gif"
width=142></A></TD>
<TD height=11 width=3></TD>
<TD align=right height=11 width=579>
<P align=right><IMG border=0 height=57 src="JaveScripta.files/5.gif"
width=550> </P></TD></TR>
<TR>
<TD bgColor=#336699 class=whiteA colSpan=3 height=30 width=760>
<TABLE border=0 width=760>
<TBODY>
<TR>
<TD width=21><IMG border=0 height=18
src="JaveScripta.files/room.gif" width=23></TD>
<TD width=281><FONT color=#ffffff size=2><!-- #BeginEditable "Current%20page" -->JavaScript脚本一 </FONT></TD>
<TD align=right class=whiteA style="COLOR: #ffffff; FONT-SIZE: 10pt"
width=438>加入收藏夹|<A
href="http://bbs.sohu.com/bbs.php3?b_id=USER_members16_dhlyh_BBS_C003_007_dhlyh"
style="COLOR: #ffffff" target=_blank>主页编程论坛</A>|<A
href="http://dhlyh.abc.yesite.com/" style="COLOR: #ffffff"
target=_blank>留言板</A>|<A
href="http://61.128.193.76:168/free/selflink/selflink.asp?id=dhlyh"
style="COLOR: #ffffff"
target=_blank>自助链接</A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=760>
<TBODY>
<TR vAlign=top>
<TD bgColor=#336699 width=1><IMG height=1 src="" width=1></TD>
<TD width=140>
<TABLE border=0 height=745 width=176>
<TBODY>
<TR bgColor=#336699>
<TD class=whiteA height=22 width=168><FONT
color=#ffffff>VisualFoxpro编程</FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD height=21 width=168><FONT size=2> <A
href="http://dhlyh.163.net/HTML/fox1_1.htm"
target=_blank>编程技巧(一)</A></FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD height=21 width=168><FONT size=2> <A
href="http://dhlyh.163.net/HTML/fox1_2.htm"
target=_blank>编程技巧(二)</A></FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD height=21 width=168><FONT size=2> <A
href="http://dhlyh.163.net/HTML/fox1_3.htm"
target=_blank>编程技巧(三)</A></FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD height=21 width=168><FONT size=2> <A
href="http://dhlyh.163.net/HTML/fox1_4.htm"
target=_blank>编程技巧(四)</A></FONT></TD></TR>
<TR bgColor=#336699>
<TD bgColor=#eaeaea height=21 width=168><FONT size=2> <A
href="http://dhlyh.163.net/HTML/fox1_5.htm"
target=_blank>编程技巧(五)</A></FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD height=23 width=168><FONT
size=2> <A
href="http://dhlyh.163.net/vfpelss.htm" target=_blank>
更多......</A></FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD bgColor=#336699 height=22 width=168><FONT
color=#ffffff>JavaScript 源 码</FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD height=24 width=168><FONT size=2> J<A
href="http://dhlyh.163.net/Jsjb1.htm">S代码(一)</A></FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD class=arial height=24 width=168><FONT size=2> <A
href="http://dhlyh.163.net/Jsjb2.htm">JS代码(二)</A></FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD bgColor=#336699 class=arial height=24 width=168><FONT
color=#ffffff> HTML技巧集锦</FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD height=24 width=168><FONT size=2> <A
href="http://dhlyh.163.net/htmljq.htm">HTML实用技巧</A></FONT></TD></TR>
<TR bgColor=#336699>
<TD bgColor=#336699 height=24 width=168><FONT
color=#ffffff> CSS及DHTML</FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD height=21 width=168><FONT size=2> <A
href="http://dhlyh.163.net/Cssd.htm">CSS DHTML技巧</A></FONT> </TD></TR>
<TR bgColor=#eaeaea>
<TD height=23 width=168><FONT size=2> <A
href="http://dhlyh.163.net/cssfilter.htm">CSS中的滤镜设置</A></FONT></TD></TR>
<TR bgColor=#336699>
<TD class=whiteA height=24 width=168><FONT
color=#ffffff> FrontPage 技巧 </FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD height=23 width=168><FONT size=2> <A
href="http://dhlyh.163.net/Jsjb1.htm"
target=_blank>高级技巧十二则 </A></FONT> </TD></TR>
<TR bgColor=#eaeaea>
<TD bgColor=#336699 height=24 width=168><FONT color=#ffffff
size=3> </FONT><FONT color=#ffffff size=3><A
href="http://dhlyh.163.net/download.htm" style="COLOR: #ffffff"
target=_blank>相关软件下载</A></FONT></TD></TR>
<TR bgColor=#eaeaea>
<TD bgColor=#ffffff height=63 width=168> <IMG border=0
height=45 src="JaveScripta.files/soh1.gif" width=150></TD></TR>
<TR bgColor=#336699>
<TD bgColor=#ffffff class=whiteA height=21 width=168>
<HR noShade SIZE=1>
</TD></TR>
<TR bgColor=#336699>
<TD bgColor=#ffffff class=whiteA height=59 width=168> <A
href="http://www.myrice.com/" target=_blank><IMG border=0 height=52
src="JaveScripta.files/myricelogo.gif" width=113></A></TD></TR>
<TR bgColor=#eaeaea>
<TD bgColor=#ffffff height=21 width=168>
<HR noShade SIZE=1>
</TD></TR>
<TR bgColor=#eaeaea>
<TD bgColor=#ffffff height=82 width=168><FONT
color=#ffffff> <A
href="http://www.coolong.com.cn/" target=_blank><IMG border=0
height=31 src="JaveScripta.files/coolong.jpg"
width=86></A> </FONT>
<HR noShade SIZE=1>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD width="100%">
<P align=center>
<SCRIPT src="JaveScripta.files/show.htm"></SCRIPT>
</P></TD></TR>
<TR>
<TD width="100%">
<SCRIPT src="JaveScripta.files/sunshow.htm"></SCRIPT>
</TD></TR>
<TR>
<TD width="100%">
<SCRIPT language=javascript src=""></SCRIPT>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
<TD bgColor=#336699 width=1><IMG height=1 src="" width=1></TD>
<TD align=middle>
<TABLE border=0 width=429>
<TBODY>
<TR>
<TD vAlign=top width=462>
<P align=left><FONT
size=2>
活动文本</FONT></P>
<FORM action=_derived/nortbots.htm method=post
onsubmit="location.href='_derived/nortbots.htm';return false;"
WEBBOT-onSubmit webbot-action="--WEBBOT-SELF--"><!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><INPUT
name=VTI-GROUP type=hidden value=0><!--webbot bot="SaveResults" endspan i-checksum="43374" -->
<P align=center><TEXTAREA cols=50 name=S1 rows=4>某些图像当鼠标移过时会变成一种模样,鼠标移开后复原,单击它时又变成另一种模样,很有趣。这种技术常用于制作活动图标。通常的实现方法比较复杂,这里介绍一种简单的实现方法:
〈a href=url target=″_blank″
onMouseOver=″document.images[1].src=''''1.gif''''″
onMouseOut=″document.images[1].src=''''2.gif''''″
onClick=″document.images[1].src=''''3.gif''''″ >〈img
src=″1.gif″>〈/a</TEXTAREA></P></FORM>
<P align=left><FONT
size=2>
</FONT><SPAN style="LINE-HEIGHT: 17pt"><FONT
size=2> 跟随鼠标的图片</FONT></SPAN> </P>
<FORM action=_derived/nortbots.htm method=post
onsubmit="location.href='_derived/nortbots.htm';return false;"
WEBBOT-onSubmit webbot-action="--WEBBOT-SELF--"><!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><INPUT
name=VTI-GROUP type=hidden value=1><!--webbot bot="SaveResults" endspan i-checksum="43406" -->
<P align=center><TEXTAREA cols=50 name=S1 rows=4>脚本说明:
第一步:把如下代码加入<body>区域中
<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>
第二步:把如下代码加入<body>区域中
<script language="javascript">
if (navigator.appName == "Netscape") {
}
else
{
document.write('<div ID=OuterDiv>')
document.write('<img ID=iit src="image1.gif" STYLE="position:absolute;TOP:0pt;LEFT:0pt;width=103;height=28;Z-INDEX:2;visibility:hidden;">')
document.write('</div>')
}
</script>
</TEXTAREA></P></FORM>
<P align=left><SPAN style="LINE-HEIGHT: 17pt"><FONT
size=2>
将本站加入到收藏夹</FONT></SPAN> </P>
<FORM action=_derived/nortbots.htm method=post
onsubmit="location.href='_derived/nortbots.htm';return false;"
WEBBOT-onSubmit webbot-action="--WEBBOT-SELF--"><!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><INPUT
name=VTI-GROUP type=hidden value=2><!--webbot bot="SaveResults" endspan i-checksum="43438" -->
<P align=center><TEXTAREA cols=50 name=S1 rows=4>script language="JavaScript">
function bookmarkit(){window.external.addFavorite('http://go.163.com/~dhlyh','网狐--数据库编程主页制作')}
if (document.all)document.write('<a href="#" onClick="bookmarkit()"><strong>将本站加入收藏夹</strong></a>')
</script></TEXTAREA></P></FORM>
<P align=left><SPAN style="LINE-HEIGHT: 17pt"><FONT
size=2><BR>
跟随鼠标的文字 以前我用过</FONT></SPAN> </P>
<FORM action=_derived/nortbots.htm method=post
onsubmit="location.href='_derived/nortbots.htm';return false;"
WEBBOT-onSubmit webbot-action="--WEBBOT-SELF--"><!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><INPUT
name=VTI-GROUP type=hidden value=3><!--webbot bot="SaveResults" endspan i-checksum="43470" -->
<P align=center><TEXTAREA cols=50 name=S1 rows=4><script>
var x,y
var step=20
var flag=0
var message=""
message=message.split("")
var xpos=new Array()
for (i=0;i<=message.length-1;i++) {
xpos[i]=-50}
var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
ypos[i]=-50}
function handlerMM(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
flag=1}
function makesnake() {
if (flag==1 && document.all) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1] }
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("span"+(i)+".style")
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i] } }
else if (flag==1 && document.layers) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1] }
xpos[0]=x+step
ypos[0]=y
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -