您现在的位置:
圆点视线
>>
教程
>>
网页设计
>>
javascript技巧
>> 文章正文
[图文]
一个鼠标效果,代码简单易懂,效果不错的
★★★
一个鼠标效果,代码简单易懂,效果不错的
作者:中国教程… 文章来源:中国教程网 点击数: 更新时间:2007-8-27 16:45:20
页面功能:【
发表评论
】【
加入收藏
】【
告诉好友
】【
打印此文
】【
关闭窗口
】
【字体:
小
大
】
var posYoubiao:Array = new Array();
posYoubiao[0] = 5;
for (i=1; i<6; i++) {
//预先设置好游标的位置
posYoubiao[i] = 5+(i)*95;
}
function youbiaoMotion(no:Number) {
youbiaoTarget = posYoubiao[no];
//从预先算好的游标位置中取得当前游标的坐标位置
youbiao0.onEnterFrame = function() {
youbiao0._x = youbiao0._x+(youbiaoTarget-youbiao0._x)*0.2;
if (Math.abs(youbiaoTarget-youbiao0._x)<=0.2) {
youbiao0._x = youbiaoTarget;
delete this.onEnterFrame;
}
};
}
//////////////按钮事件/////////////
for (i=0; i<6; i++) {
this["topMenu_btn"+i].no = i;
this["topMenu_btn"+i].useHandCursor = false;
this["topMenu_btn"+i].onRollOver = function() {
if (nowYoubiao != this.no) {
youbiaoMotion(this.no);
}
};
this["topMenu_btn"+i].onRelease = function() {
//鼠标点击事件
};
}
////////////////////////
【
发表评论
】【
加入收藏
】【
告诉好友
】【
打印此文
】【
关闭窗口
】 文章录入:Rainsion 责任编辑:Rainsion 【字体:
小
大
】
上一篇文章:
JavaScript的目的
下一篇文章:
网页最简短的拖动对象代码实例演示
最新文章
相关文章
没有相关文章
网友评论:
(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
发表评论:
姓 名:
评 分:
1分
2分
3分
4分
5分
评论内容:
·严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
·用户需对自己在使用本网服务过程中的行为承担法律责任
·本站管理员有权保留或删除评论内容。
·评论内容只代表机友个人观点,与本网站立场无关。
最 新 推 荐
百度主题推广
最 新 热 门