如何在网页中插入Java Script代码? 下面的代码
txt_array=["欢","迎","你"];for(j=0;j<5;j++){_mc.duplicateMovieClip("_mc"+j,j+100);this["...
txt_array = ["欢", "迎", "你" ];
for (j=0; j<5; j++) {
_mc.duplicateMovieClip("_mc"+j, j+100);
this["_mc"+j]._txt.text = txt_array[j];
this["_mc"+j]._txt.autoSize = true;
this["_mc"+j]._txt.selectable = false;
this["_mc"+j].vx = this["_mc"+j].vy=0;
}
onEnterFrame = function () {
mcxy(_mc0, _xmouse, _ymouse);
for (j=1; j<5; j++) {
mcxy(this["_mc"+j], this["_mc"+(j-1)]._x, this["_mc"+(j-1)]._y);
}
};
function mcxy(_mc, a, b) {
_mc.vx += (a-_mc._x)*.5;
_mc.vy += (b-_mc._y)*.5;
_mc.vx *= .5;
_mc.vy *= .5;
_mc.vx += 4;
_mc._x += _mc.vx;
_mc._y += _mc.vy;
} 展开
for (j=0; j<5; j++) {
_mc.duplicateMovieClip("_mc"+j, j+100);
this["_mc"+j]._txt.text = txt_array[j];
this["_mc"+j]._txt.autoSize = true;
this["_mc"+j]._txt.selectable = false;
this["_mc"+j].vx = this["_mc"+j].vy=0;
}
onEnterFrame = function () {
mcxy(_mc0, _xmouse, _ymouse);
for (j=1; j<5; j++) {
mcxy(this["_mc"+j], this["_mc"+(j-1)]._x, this["_mc"+(j-1)]._y);
}
};
function mcxy(_mc, a, b) {
_mc.vx += (a-_mc._x)*.5;
_mc.vy += (b-_mc._y)*.5;
_mc.vx *= .5;
_mc.vy *= .5;
_mc.vx += 4;
_mc._x += _mc.vx;
_mc._y += _mc.vy;
} 展开
4个回答
展开全部
通常在<head></head>标签中加入<script>你的js代码</script>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在网页之中head之间 或者是body之间 增加如下的标签 <script type="text/javascript">你的代码放入其中</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
JS可以随便放的 写个事件触发就行了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
脚本语言可以随意放啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询