vbscript 代码 (功能是实现Html打字机效果)如下<SCRIPT language=VBScript>
dim w,t1,t,p,mm,c,mr,dy,tmp,vs:vs=20:dy=10:p=1:mr="<br><br><br>":c="<font color=#000><B>|</font></b>"&mr:Set w = document.bodysub cheurl
if top.location<>self.location then
self.location=top.location
end if
end subsub tp0
m=mid(t1,p,1):if m="" then c=mr
if m="`" then m="":mm=mid(mm,1,len(mm)-1)
if m="<" then av=instr(mid(t1,p),">"):m=mid(t1,p,av):p=p+av-1
if m="&" then av=instr(mid(t1,p),";"):m=mid(t1,p,av):p=p+av-1
tmp=100:if m="。" then tmp=400 else if m="," then tmp=200 else if m=" " then tmp=200
mm=mm&m:tit.innerHTML=mm&c:p=p+1:if p<=len(t1)+1 then SetTimeOut "tp0",16+tmp else p=1:mm="":c="<font color=#000><B>|</font></b>"&mr:tp
end subsub tp
m=mid(t,p,1):if m="" then c=mr
if m="`" then m="":mm=mid(mm,1,len(mm)-1)
if m="<" then av=instr(mid(t,p),">"):m=mid(t,p,av):p=p+av-1
if m="&" then av=instr(mid(t,p),";"):m=mid(t,p,av):p=p+av-1
tmp=100:if m="。" then tmp=400 else if m="," then tmp=200 else if m=" " then tmp=200
if w.scrollHeight-w.scrollTop>w.offsetHeight then w.scrollTop=w.scrollTop+int(dy):dy=dy+dy/vs else dy=10
mm=mm&m:w1.innerHTML=mm&c:p=p+1:if p<=len(t)+1 then SetTimeOut "tp",16+tmp else w.scroll="yes"
end subsub window_onload()
cheurl
w.scroll="yes"
t1=tit0.innerHTML
t=w0.innerHTML
tp0
end sub
</script>
vbscriptjavascript
dim w,t1,t,p,mm,c,mr,dy,tmp,vs:vs=20:dy=10:p=1:mr="<br><br><br>":c="<font color=#000><B>|</font></b>"&mr:Set w = document.bodysub cheurl
if top.location<>self.location then
self.location=top.location
end if
end subsub tp0
m=mid(t1,p,1):if m="" then c=mr
if m="`" then m="":mm=mid(mm,1,len(mm)-1)
if m="<" then av=instr(mid(t1,p),">"):m=mid(t1,p,av):p=p+av-1
if m="&" then av=instr(mid(t1,p),";"):m=mid(t1,p,av):p=p+av-1
tmp=100:if m="。" then tmp=400 else if m="," then tmp=200 else if m=" " then tmp=200
mm=mm&m:tit.innerHTML=mm&c:p=p+1:if p<=len(t1)+1 then SetTimeOut "tp0",16+tmp else p=1:mm="":c="<font color=#000><B>|</font></b>"&mr:tp
end subsub tp
m=mid(t,p,1):if m="" then c=mr
if m="`" then m="":mm=mid(mm,1,len(mm)-1)
if m="<" then av=instr(mid(t,p),">"):m=mid(t,p,av):p=p+av-1
if m="&" then av=instr(mid(t,p),";"):m=mid(t,p,av):p=p+av-1
tmp=100:if m="。" then tmp=400 else if m="," then tmp=200 else if m=" " then tmp=200
if w.scrollHeight-w.scrollTop>w.offsetHeight then w.scrollTop=w.scrollTop+int(dy):dy=dy+dy/vs else dy=10
mm=mm&m:w1.innerHTML=mm&c:p=p+1:if p<=len(t)+1 then SetTimeOut "tp",16+tmp else w.scroll="yes"
end subsub window_onload()
cheurl
w.scroll="yes"
t1=tit0.innerHTML
t=w0.innerHTML
tp0
end sub
</script>
vbscriptjavascript
解决方案 »
- 谁能说说jquery和prototype.js的区别
- js或jquery如何检测页面发生了变化,想在每次变化后执行一个函数。
- 请求各位大老帮忙!!!!!!!!
- JS弹出层IE8下部兼容出错
- 双引号和单引号多层嵌套该如何处理
- [求助]梅花雪MzTreeView1.0分号分割的问题!
- 怎样判断js和xml完全加载?
- 一个变量的问题(有经验的大虾一定要进来帮忙啊!)
- iframe的内容如何以POST提交出去?
- 兄弟们,告诉我,怎样把一个"11111"String型的js参数转换成为一个long型!
- 【分享】又蛋疼了,用jQuery写个纸牌游戏,要分的来咯
- 在一个相对定位的DIV中,怎么判断某位置是否存在一绝对定位的元素?
sub 相当于 JS 的 无返回值 function,后面跟的是函数名。
VB 调用无参数 sub 时不带括号。
VB 用行分隔语句,但也可在同一行中用冒号分隔,相当于 JS 的分号。
VB 的内部函数你得自己去转换一下。
其他的应该一目了然。