怎样使用特效代码?
只要把这些代码复制、粘贴到你的网页源代码中,保存,再在浏览器中打开,你就会看到效果了!
怎样在我的网页中插入代码?
·使用DreamWeaver:
在编辑状态下按F10即弹出源代码窗口,将特效代码粘贴进去即可。
·使用FrontPage:
点击编辑窗口左下角的“HTML”选项卡即出现源代码窗口,将特效代码粘贴进去即可。
·直接使用“记事本”等编辑器:
直接用这些编辑器打开网页文件,出现的就是源代码,将特效代码粘贴进去即可。
在什么地方插入代码?
一般来说,在网页源代码的<body>与</body>之间的任何地方插入代码都可以(除非特别指明,例如要求插入到<head>与</head>之间)。
提示:在<td>与</td>之间插入代码,一般不会出错。
该怎样修改代码?
插入代码之后,把代码中的文字替换成你自己的内容即可。
注意:为避免出错,请不要改动除中文文字之外的代码,否则程序可能会不能运行!
例: 自由图片
<div id="helpor_net" style="position:absolute; visibility:visible; left:0px; top:0px; z-index:-1">
<img src="http://code.helpor.net/picture/swimming.gif" border="0">
</div>
<SCRIPT LANGUAGE="JavaScript">
<!--
var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
var _all = '';
var _style = '';
var wwidth, wheight;
var ydir = '++';
var xdir = '++';
var id1, id2, id3;
var x = 1;
var y = 1;
var x1, y1;
if(!isNS) {
_all='all.';
_style='.style';
}
function www_helpor_net() {
clearTimeout(id1);
clearTimeout(id2);
clearTimeout(id3);
if (isNS) {
wwidth = window.innerWidth - 55;
wheight = window.innerHeight - 50;
} else {
wwidth = document.body.clientWidth - 55;
wheight = document.body.clientHeight - 50;
}
id3 = setTimeout('randomdir()', 20000);
animate();
}
function randomdir() {
if (Math.floor(Math.random()*2)) {
(Math.floor(Math.random()*2)) ? xdir='--': xdir='++';
} else {
(Math.floor(Math.random()*2)) ? ydir='--': ydir='++';
}
id2 = setTimeout('randomdir()', 20000);
}
function animate() {
eval('x'+xdir);
eval('y'+ydir);
if (isNS) {
helpor_net.moveTo((x+pageXOffset),(y+pageYOffset))
} else {
helpor_net.pixelLeft = x+document.body.scrollLeft;
helpor_net.pixelTop = y+document.body.scrollTop;
}
if (isNS) {
if (helpor_net.top <= 5+pageYOffset) ydir = '++';
if (helpor_net.top >= wheight+pageYOffset) ydir = '--';
if (helpor_net.left >= wwidth+pageXOffset) xdir = '--';
if (helpor_net.left <= 5+pageXOffset) xdir = '++';
} else {
if (helpor_net.pixelTop <= 5+document.body.scrollTop) ydir = '++';
if (helpor_net.pixelTop >= wheight+document.body.scrollTop) ydir = '--';
if (helpor_net.pixelLeft >= wwidth+document.body.scrollLeft) xdir = '--';
if (helpor_net.pixelLeft <= 5+document.body.scrollLeft) xdir = '++';
}
id1 = setTimeout('animate()', 30);
}
var helpor_net=eval('document.'+_all+'helpor_net'+_style);
// -->
</script>
再把<body>改为:
<body OnLoad="www_helpor_net()" OnResize="www_helpor_net()"