js控制弹出栏

来源:互联网 发布:人工智能 国语 迅雷 编辑:程序博客网 时间:2024/05/17 04:38
 
Q: 文本随机输出,可以用来作公告栏
A:
脚本说明 :
第一步 : 把如下代码加入 <head> 区域中
<SCRIPT LANGUAGE="javascript">
<!-- Original: Tarjei Davidsen (the@rescueteam.com) -->

<!-- This script and many more are available free online at -->
<!-- The javascript Source!! javascript.internet.com -->

<!-- Begin
var max=0;
function textlist() { i++:textlist.arguments[i]; max }
tl = new textlist(
"
随着 INTERNET 时代的逐步到来 , 人们对网络的认识与感知越来越深刻 ",
"
上网主要是进行 web 页面浏览,所以 web 页面的精彩程度对一个网站的生 ",
"
人通过制作个人主页展现自己的才华,而且,由于出现了多种制作网页的软件 ",
"
但是,光用软件就成制作出你想要的各种页面效果吗?答案肯定是否定的但是,光用软件就成制作出你想要的各种页面效果吗?答案肯定是否定的 ",
"javascript
Netscape( 网景 ) 公司首先推出的一种针对 WEB 页面的解释型语 "
);

var x = 0; pos = 0;
var l = tl[0].length;
function textticker() {
document.tickform.tickfield.value = tl[x].substring(0, pos) + "_";
if(pos++ == l) {
pos = 0;
setTimeout("textticker()", 2000);
if(++x == max) x = 0;
l = tl[x].length;
} else
setTimeout("textticker()", 50);
}
// End -->
</script>
</HEAD>


第二步 : 把如下代码加入 <body> 区域中
<form name=tickform>
<textarea name=tickfield rows=3 cols=38 style="background-color: rgb(0,0,0); color: rgb(255,255,255); cursor: default; font-size: 12px" wrap=virtual>The news will appear here when the page has finished loading.
</textarea>
</form>


第三步 : <body> 改为
<body bgcolor="#fef4d9" OnLoad="textticker()">

Q:
进入页面自动弹出的欢迎致词,个人网站可加......
A:
今天在公司网站上抓的,进入页面自动弹出的欢迎致词,个人网站可加上不免没有加好呀。加的位置应该可以看懂吧。
<html>
<head>
</head>
<body>
</body>
<script language="vbscript">
<!--
MsgBox"
欢迎光临我的网站!"
-->
</script>
</html>

Q:
页面自动刷新说明
A:
当你做网页时,是不是有的时候想让你的网页自动不停刷新,或者过一段时间自动跳转到另外一个你自己设定的页面?其实实现这个效果非常地简单,而且这个效果甚至不能称之为特效。你只要把如下代码加入你的网页中就可以了。

1
,页面自动刷新:把如下代码加入<head>区域中<meta http-equiv="refresh" content="20">,其中20指每隔20秒刷新一次页面.

2
,页面自动跳转:把如下代码加入<head>区域中<meta http-equiv="refresh" content="20;url=http://www.163.com">,其中20指隔20秒后跳转到http://www.163.com页面。


Q:
鼠标箭头变十字架代码(对一些特殊的网页有用) .
A:
你们自己试试效果就知道了.

<script language="javascript1.2">
<!--
if (document.all&&!window.print){
leftright.style.width=document.body.clientWidth-2
topdown.style.height=document.body.clientHeight-2
}
else if (document.layers){
document.leftright.clip.width=window.innerWidth
document.leftright.clip.height=1
document.topdown.clip.width=1
document.topdown.clip.height=window.innerHeight
}
function followmouse1(){
//move cross engine for IE 4+
leftright.style.pixelTop=document.body.scrollTop+event.clientY+1
topdown.style.pixelTop=document.body.scrollTop
if (event.clientX<document.body.clientWidth-2)
topdown.style.pixelLeft=document.body.scrollLeft+event.clientX+1
else
topdown.style.pixelLeft=document.body.clientWidth-2
}
function followmouse2(e){
//move cross engine for NS 4+
document.leftright.top=e.y+1
document.topdown.top=pageYOffset
document.topdown.left=e.x+1
}
if (document.all)
document.onmousemove=followmouse1
else if (document.layers){
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=followmouse2
}
function regenerate(){
window.location.reload()
}
function regenerate2(){
setTimeout("window.onresize=regenerate",400)
}
if ((document.all&&!window.print)||document.layers)
//if the user is using IE 4 or NS 4, both NOT IE 5+
window.onload=regenerate2
//-->
</script>
<style>
<!--
#leftright, #topdown{
position:absolute;
left:0;
top:0;
width:1px;
height:1px;
layer-background-color:#B0D0F8;
background-color:#00eeff;
z-index:100;
font-size:1px;
}
-->
</style>

【貼上】然後切換到您的網頁,按『Ctrl+V』將剛剛複製的程式碼貼在</head>之前。


<div id="leftright" style="width:expression(document.body.clientWidth-2)">
</div>
<div id="topdown" style="height:expression(document.body.clientHeight-2)">
</div>

【貼上】然後切換到您的網頁,按『Ctrl+V』將剛剛複製的程式碼貼在<body>之後任何位置。

【修改程式碼】
若想改改線的顏色,那就改background-color:#00eeff;這部份,後面的顏色碼就行了。
 
 
 
 
Q: 文本随机输出,可以用来作公告栏,一个字一个字的输出,不错。。。
A:
脚本说明:
第一步:把如下代码加入<head>区域中
<SCRIPT LANGUAGE="javascript">
<!-- Original: Tarjei Davidsen (the@rescueteam.com) -->

<!-- This script and many more are available free online at -->
<!-- The javascript Source!! javascript.internet.com -->

<!-- Begin
var max=0;
function textlist() {
max=textlist.arguments.length;
for (i=0; i<max; i++)
this[i]=textlist.arguments[i];
}
tl = new textlist(
"
随着INTERNET时代的逐步到来,人们对网络的认识与感知越来越深刻",
"
上网主要是进行web页面浏览,所以web页面的精彩程度对一个网站的生",
"
人通过制作个人主页展现自己的才华,而且,由于出现了多种制作网页的软件",
"
但是,光用软件就成制作出你想要的各种页面效果吗?答案肯定是否定的但是,光用软件就成制作出你想要的各种页面效果吗?答案肯定是否定的",
"javascript
Netscape(网景)公司首先推出的一种针对WEB页面的解释型语"
);

var x = 0; pos = 0;
var l = tl[0].length;
function textticker() {
document.tickform.tickfield.value = tl[x].substring(0, pos) + "_";
if(pos++ == l) {
pos = 0;
setTimeout("textticker()", 2000);
if(++x == max) x = 0;
l = tl[x].length;
} else
setTimeout("textticker()", 50);
}
// End -->
</script>
</HEAD>


第二步:把如下代码加入<body>区域中
<form name=tickform>
<textarea name=tickfield rows=3 cols=38 style="background-color: rgb(0,0,0); color: rgb(255,255,255); cursor: default; font-size: 12px" wrap=virtual>The news will appear here when the page has finished loading.</textarea>
</form>


第三步:<body>改为
<body bgcolor="#fef4d9" OnLoad="textticker()">
 
原创粉丝点击