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

改變網(wǎng)頁顏色的JS調(diào)色板

2018-07-20    來源:open-open

容器云強勢上線!快速搭建集群,上萬Linux鏡像隨意使用
<script LANGUAGE="JavaScript">

var hex = new Array(6)<!--定義數(shù)組變量-->

hex[0] = "FF"
hex[1] = "CC"
hex[2] = "99"
hex[3] = "66"
hex[4] = "33"
hex[5] = "00"
function display(triplet) 
{
	document.bgColor = '#' + triplet<!--根據(jù)輸入的triplet,更新窗口的背景顏色-->
	alert('現(xiàn)在的背景顏色代碼是: ' + triplet)<!--彈出提示窗口-->
}
function drawCell(red, green, blue) 
{
	document.write('<TD BGCOLOR="#' + red + green + blue + '">')<!--定義小方格內(nèi)的背景顏色-->
	document.write('<A HREF="javascript:display(\'' + (red + green + blue) + '\')">')<!--定義超鏈接,調(diào)用display函數(shù)-->
	document.write('<IMG SRC="place.gif" BORDER=0 HEIGHT=12 WIDTH=12>')<!--引用圖片-->
	document.write('</A>')
	document.write('</TD>')
}
function drawRow(red, blue) 
{
	document.write('<TR>')
	for (var i = 0; i < 6; ++i) <!--循環(huán)6次-->
{
		drawCell(red, hex[i], blue)<!--一行6個小方格內(nèi)部的顏色差別在于red和blue分量-->
	}
	document.write('</TR>')
}
function drawTable(blue) {
	document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>')
	for (var i = 0; i < 6; ++i) {<!--循環(huán)6次-->
		drawRow(hex[i], blue)<!--每個表格總體的顏色差別在于藍色分量的不同-->
	}
	document.write('</TABLE>')	
}
function drawCube() {
	document.write('<TABLE CELLPADDING=5 CELLSPACING=0 BORDER=1><TR>')
	for (var i = 0; i < 6; ++i) {
		document.write('<TD BGCOLOR="#FFFFFF">')<!--定義表格的背景顏色為白色-->
		drawTable(hex[i])<!--循環(huán)畫出每一個表格-->
		document.write('</TD>')
	}
	document.write('</TR></TABLE>')
}
drawCube()<!--直接調(diào)用drawCube()函數(shù)-->

</script>

<body>

單擊上面的調(diào)色板試試
</body>

</html>
<!--本例程實現(xiàn)了調(diào)色板的功能-->
<!--顏色的基本構(gòu)成,以及調(diào)配方法-->
<!--超連接的使用-->
<!--彈出窗口的使用-->

標簽: isp 代碼

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

上一篇: 使用iText生成PDF

下一篇:python自動裁剪圖像