不是弱,慢慢来
不过你可以先搜索搜索呀
到这里搜索
或者到google里面搜索
不过你可以先搜索搜索呀
到这里搜索
或者到google里面搜索
解决方案 »
- 为什么出现 is not a function?
- 用window.open调用弹出一窗口会自动关闭
- “Automation 服务器不能创建对象” 谁说容易解决
- 验证码的问题,高分求解!!!
- [求助]如何用javaScript控制让一个层显示的时候,画面其他部分都不能点
- 哪里可以下载到比较好的javasvript资料啊?
- 关于radio事件问题!
- 在JS里面我要把“abcd” 替换成 “1234” 怎么替换呀
- 为何IE浏览器默认不支持js.
- 在Firefox中如何限制textarea每行输入的字符数?
- 请教JS高手
- 能不能在主页中显示一个目录中的所有文件的名称,大小,类型,修改时间等功能呢?(在线)
请问在js里有settimeout这函数吗
<!--
function scrollit(seed) {
var m1 = "HI,您 好 ! ";
var m2 = "欢 迎 访 问 xx 网 ! ";
var m3 = "请 多 提 意 见,谢 谢 ! ";
var m4 = "E-MAIL:[email protected] ";
var m5 = "http://www.kings2.net ";
var msg=m1+m2+m3+m4+m5;
var out = " ";
var c = 1;
if (seed > 100) {
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
}
}
}
//-->
第二步:把如下代码加入<body>区域中
<body background=bag.gif onLoad="scrollit(100)">
我找的也是这段代码,可是循环了几次就中断了,而且字走的太快了
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>多变的状态栏文字</title>
</head>
<script language="vbscript">
<!--
dim tid
dim scroll_msg,scroll_out,scroll_pos,scroll_delay
scroll_msg="欢迎你使用VBScript编程百例"
scroll_out=""
scroll_pos=100
scrol_delay=5
sub scroller
for i=1 to scroll_pos
scroll_out=scroll_out&" "
next
if scroll_pos>0 then
scroll_out=scroll_out&scroll_msg
else
scroll_out=mid(scroll_msg,-scroll_pos+1,len(scroll_msg))
end if
window.status=scroll_out
scroll_out=""
scroll_pos=scroll_pos-1
if scroll_pos<-len(scroll_msg) then scroll_pos=100
tid=settimeout("scroller()",scroll_delay)
end sub
function snapin(jumpspaces,position)
dim msg
msg=scroll_msg
dim out
out=""
for i=1 to position
out=out&mid(msg,i,1)
next
for i=1 to jumpspaces-1
out=out&" "
next
out=out&mid(msg,position+1,1)
window.status=out
if (jumpspaces<=1) then
position=position+1
if mid(msg,position,1)=" " then position=position+1
jumpspaces=100-position
else
if (jumpspaces>3) then
jumpspaces=jumpspaces*0.75
else
jumpspaces=jumpspaces-1
end if
end if
if (position<len(msg)) then
cmd="snapin "&jumpspaces&","&position
tid=window.settimeout(cmd,scroll_delay)
else
window.status=""
jumpspaces=100
position=1
cmd="snapin "&jumpspaces&","&position
tid=window.settimeout(cmd,scroll_delay)
end if
end function
-->
</script>
<script language="vbscript">
dim speed
speed=200
dim messages(2)
messages(0)="欢迎你使用VBScript编程百例"
messages(1)="有问题请和本出版社联系"
messages(2)="谢谢你的支持"
dim currentmessage
currentmessage=0
dim offset
offset=0
sub showbanner
dim text
text=messages(currentmessage)
if offset<len(text) then
if mid(text,offset+1,1)=" " then offset=offset+1
dim partialmessage
partialmessage=mid(text,1,offset+1)
window.status=partialmessage
offset=offset+1
tid=settimeout("showbanner",speed)
else
offset=0
currentmessage =currentmessage+1
if (currentmessage>ubound(messages)) then currentmessage=0
tid=settimeout("showbanner",pause)
end if
end sub
</script>
<body bgcolor=peachpuff>
<center>
<h1><font color=red>文字显示状态</font></h1>
<input type=button value="雨 点 式" id=button2 name=button2 onclick="cleartimeout(tid):snapin 100,1">
<br><br>
<input type=button value="多行舒展式" id=button3 name=button3 onclick="cleartimeout(tid):showbanner">
</center>
</body></html>
一步搞定
我还想问问lei414(加班王子)
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
一定要写成这样吗,写成
wingdow.setTimeout("scrollit("+seed+")",100)不行吗
不是settimeout
而是setTimeout
唉我错了,ie也不告诉我一声,害的我忙了一天
谢谢各位了:)