?? 5-10.htm
字號:
<SCRIPT LANGUAGE="JavaScript">
if (document.all)
{
yourLogo = "I love JavaScript very much----!"; <!--待旋轉的文字-->
logoFont = "Arial"; <!--文字的字體-->
logoColor = "FF0000"; <!--文字的顏色-->
yourLogo = yourLogo.split(''); <!--將旋轉的字符串分成單個的字符-->
L = yourLogo.length; <!--獲得字符串的長度-->
TrigSplit = 360 / L; <!--設置每次旋轉的角度-->
Sz = new Array() <!--聲明一個數組-->
logoWidth = 100; <!--定義寬度-->
logoHeight = -30; <!--定義高度-->
ypos = 0;
xpos = 0;
step = 0.03; <!--定義步長-->
currStep = 0;
document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i = 0; i < L; i++)
{
document.write('<div id="ie" style="position:absolute;top:0px;left:0px;'+'width:10px;height:10px;font-family:'+logoFont+';font-size:12px;'+'color:'+logoColor+';text-align:center">'+yourLogo[i]+'</div>'); <!--依次顯示每一個字符-->
}
document.write('</div></div>');
function Mouse()
{
ypos = event.y; <!--獲得當前鼠標的縱坐標-->
xpos = event.x - 5; <!--獲得當前鼠標的橫坐標-->
}
document.onmousemove=Mouse; <!--鼠標移動后調用mouse函數-->
function animateLogo()
{
<!--獲得當前窗口的坐標-->
outer.style.pixelTop = document.body.scrollTop;
for (i = 0; i < L; i++)
{
ie[i].style.top = ypos + logoHeight * Math.sin(currStep + i * TrigSplit * Math.PI / 180); <!--獲得第i個字符的上邊界-->
ie[i].style.left = xpos + logoWidth * Math.cos(currStep + i * TrigSplit * Math.PI / 180); <!--獲得第i個字符的左邊界-->
Sz[i] = ie[i].style.pixelTop - ypos; <!--設置字體-->
if (Sz[i] < 5) Sz[i] = 5; <!--設置字體-->
ie[i].style.fontSize = Sz[i] / 1.7; <!--當前字體的變化-->
}
currStep -= step;
setTimeout('animateLogo()', 20); <!--動畫的實現-->
}
window.onload = animateLogo; <!--直接調用animatelogo函數-->
}
</script>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -