熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Javascript >> 正文

一個鼠標效果,代碼簡單易懂,效果不錯的

2013-11-23 17:54:11  來源: Javascript 
var posYoubiao:Array = new Array(); 
posYoubiao[] = 
for (i=; i<; i++) { 
        //預先設置好游標的位置 
        posYoubiao[i] = +(i)*

function youbiaoMotion(no:Number) { 
        youbiaoTarget = posYoubiao[no]; 
        //從預先算好的游標位置中取得當前游標的坐標位置 
        youbiaoonEnterFrame = function() { 
                youbiao_x = youbiao_x+(youbiaoTargetyoubiao_x)*
                if (Mathabs(youbiaoTargetyoubiao_x)<=) { 
                        youbiao_x = youbiaoTarget; 
                        delete thisonEnterFrame; 
                } 
        }; 
}

//////////////按鈕事件/////////////


for (i=; i<; i++) { 
        this[topMenu_btn+i]no = i; 
        this[topMenu_btn+i]useHandCursor = false; 
        this[topMenu_btn+i]onRollOver = function() { 
                if (nowYoubiao != thisno) { 
                        youbiaoMotion(thisno); 
                } 
        }; 
        this[topMenu_btn+i]onRelease = function() { 
                //鼠標點擊事件 
        }; 
}
////////////////////////
From:http://tw.wingwit.com/Article/program/Java/Javascript/201311/25318.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.