中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

JavaScript實(shí)現(xiàn)的隨機(jī)色標(biāo)簽云

2018-07-20    來(lái)源:open-open

容器云強(qiáng)勢(shì)上線!快速搭建集群,上萬(wàn)Linux鏡像隨意使用
<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>無(wú)標(biāo)題文檔</title>

<style type="text/css">

*{

    margin:0;

    padding:0

}

a{ 

    text-decoration:none

}


#wrap{

    width:400px;

    margin:auto

}

</style>

</head>


<body>

<div id="wrap">

<a href="#">web標(biāo)準(zhǔn)學(xué)習(xí)</a>

   <a href="#">css</a>

   <a href="#">javascript</a>

   <a href="#">html5</a>

   <a href="#">canvas</a>

   <a href="#">video</a>

   <a href="#">audio</a>

   <a href="#">jQuery</a>

   <a href="#">jQuerymobile</a>

   <a href="#">flash</a>

   <a href="#">firefox</a>

   <a href="#">chrome</a>

   <a href="#">opera</a>

   <a href="#">IE9</a>

   <a href="#">css3.0</a>

   <a href="#">andriod</a>

   <a href="#">apple</a>

   <a href="#">google</a>

   <a href="#">jobs</a>

</div>

<script type="text/javascript">


//隨機(jī)方法

function rand(num)

{

return parseInt(Math.random()*num+1);

}


//隨機(jī)顏色值

function randomColor()

{

var str = Math.ceil((Math.random()*16777215)).toString(16); //把數(shù)字轉(zhuǎn)換成16進(jìn)制

if(str.length < 6)

{

str = "0" + str;

}

return str;

}



//標(biāo)簽實(shí)現(xiàn)

var aList = document.getElementById("wrap").getElementsByTagName("a");

var i = 0;

var len = aList.length;

for(i;i<len;i++)

{

aList[i].className = "color"+rand(5); //生成隨機(jī)類名

aList[i].style.fontSize = rand(12)+12+"px"; //隨機(jī)字號(hào)

aList[i].style.color = "#"+randomColor();

aList[i].onmouseover = function()

{

this.style.background = "#"+randomColor();

}

aList[i].onmouseout = function()

{

this.style.background = "";

}

}

</script>

</body>

</html>

標(biāo)簽: Google seo

版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請(qǐng)聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點(diǎn)!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請(qǐng)與原作者聯(lián)系。

上一篇:C# XML的讀寫(xiě)

下一篇:簡(jiǎn)單的 java圖片瀏覽器示例