Dreamweaver 里制作状态栏里的滚动信息的代码是什么?
我尝试了下面的代码,但是没有成功.不知道是不是要用键盘全部输入进去,而不能复制--->粘贴.<ScriptLanguage=“JavaScript”><!--functi...
我尝试了下面的代码,但是没有成功.不知道是不是要用键盘全部输入进去,而不能复制---> 粘贴.
<Script Language=“Java Script”><!- - function scroll(seed)
{var m1=“欢迎光临!这里是子凌的梦工厂。”; var m2=“如果有什么问题,请与我联系。”; var m3=“谢谢!”;“ var Msg=m1+m2+m3; var out=“ ”; var c=1; if(seed>150){ seed- -;
var cmd=“scroll(“+seed+”)”;
timeTwo=window.setTimeout(cmd,100);}
else if (seed<=150 &&seed>0){
for (c=o;c<seed;C++){
out+=“ ”; } out+=Msg;
seed- -;
Var cmd=“Scroll“+seed+”)”;
Window.status=out;
TimeTwo=Window.SetTimeout(cmd,100); } else if (seed<=0){
if(-seed<msg.lenth){ out+=smg.substring(-seed,msg.length); seed- -; var cmd=“scroll(“+seed+”)”; window.status=out; timerTwo=window.setTimeout(cmd,100); } else{window.status=” ”; timerTwo=window.setTimeout(“scro11(150)”,7); }}} timeONE=window.setTimeout (“scrou(150)”,50);
//- -></scritp>;
请大家,看看代码有没有错误, 如果错了,那什么样的代码才是正确的?
谢谢! 展开
<Script Language=“Java Script”><!- - function scroll(seed)
{var m1=“欢迎光临!这里是子凌的梦工厂。”; var m2=“如果有什么问题,请与我联系。”; var m3=“谢谢!”;“ var Msg=m1+m2+m3; var out=“ ”; var c=1; if(seed>150){ seed- -;
var cmd=“scroll(“+seed+”)”;
timeTwo=window.setTimeout(cmd,100);}
else if (seed<=150 &&seed>0){
for (c=o;c<seed;C++){
out+=“ ”; } out+=Msg;
seed- -;
Var cmd=“Scroll“+seed+”)”;
Window.status=out;
TimeTwo=Window.SetTimeout(cmd,100); } else if (seed<=0){
if(-seed<msg.lenth){ out+=smg.substring(-seed,msg.length); seed- -; var cmd=“scroll(“+seed+”)”; window.status=out; timerTwo=window.setTimeout(cmd,100); } else{window.status=” ”; timerTwo=window.setTimeout(“scro11(150)”,7); }}} timeONE=window.setTimeout (“scrou(150)”,50);
//- -></scritp>;
请大家,看看代码有没有错误, 如果错了,那什么样的代码才是正确的?
谢谢! 展开
5个回答
展开全部
用这个吧,你的太乱了:
<SCRIPT LANGUAGE=JAVASCRIPT>
<!--
var msg = "状态栏上的文字";
var speed = 300;
var msgud = " " + msg;
function statusScroll() {
if (msgud.length <msg.length) msgud += " - " + msg;
msgud = msgud.substring(1, msgud.length);
window.status = msgud.substring(0, msg.length);
window.setTimeout("statusScroll()", speed);
}
</SCRIPT>
<BODY onload="window.setTimeout('statusScroll()', 500)">
<SCRIPT LANGUAGE=JAVASCRIPT>
<!--
var msg = "状态栏上的文字";
var speed = 300;
var msgud = " " + msg;
function statusScroll() {
if (msgud.length <msg.length) msgud += " - " + msg;
msgud = msgud.substring(1, msgud.length);
window.status = msgud.substring(0, msg.length);
window.setTimeout("statusScroll()", speed);
}
</SCRIPT>
<BODY onload="window.setTimeout('statusScroll()', 500)">
展开全部
不用的,可能 是其他问题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
问题是你的源代码里的符号有错误
就是引号和分号
就是引号和分号
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
重新找个特效试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
第一步:把如下代码加入<head>区域中
<SCRIPT language="JavaScript">
<!--
function scrollit(seed) {
var m1 = "HI:你 好! ";
var m2 = "欢 迎 访 问 我 的 网 站 ";
var m3 = "请 多 提 意 见,谢 谢! ";
var m4 = "网站:http://www.XXXXXX.com ";
var m5 = "http://www.chcinc.com ";
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);
}
}
}
//-->
</SCRIPT>
第二步:把如下代码加入<body>区域中
<body background=bag.gif onLoad="scrollit(100)">
<SCRIPT language="JavaScript">
<!--
function scrollit(seed) {
var m1 = "HI:你 好! ";
var m2 = "欢 迎 访 问 我 的 网 站 ";
var m3 = "请 多 提 意 见,谢 谢! ";
var m4 = "网站:http://www.XXXXXX.com ";
var m5 = "http://www.chcinc.com ";
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);
}
}
}
//-->
</SCRIPT>
第二步:把如下代码加入<body>区域中
<body background=bag.gif onLoad="scrollit(100)">
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询