Home
visit our sponsor
Dynamic Html Main Page
 

เปลี่ยนสี Background ได้ดังใจคุณ

 


นำ Code ไปวางไว้ในส่วนของ <HEAD>หมายเหตุ : เปลี่ยนชื่อไฟล์ .html ตรงที่เป็นสีเขียวให้เป็นชื่อเดียวกับไฟล์ .html ของคุณเอง

<SCRIPT LANGUAGE="JavaScript">
<!-- Hide JavaScript from Java-Impaired Browsers
locnm=location.href;
locnm1=locnm.substring(0,(locnm.indexOf("
backcolsam.html")));

function getCol() {
coord=locnm.substring(posx+3,locnm.length);
posx=coord.indexOf("&")
xcoord=coord.substring(0,posx);
coord=coord.substring(posx+1,coord.length);
posx=coord.indexOf(".y=")
ycoord=coord.substring(posx+3,coord.length);
if (xcoord<8){color="#FFFF00";}
else if (xcoord<16){color="#00FF00";}
else if (xcoord<24){color="#00FFFF";}
else if (xcoord<32){color="#FF00FF";}
else if (xcoord<40){color="#FF0000";}
else if (xcoord<48){color="#009FDD";}
else if (xcoord<56){color="#B2B2B2";}
else if (xcoord<64){color="#FFD25D";}
else if (xcoord<72){color="#56AB6B";}
else if (xcoord<80){color="#C70065";}
else if (xcoord<88){color="#A25C92";}
else if (xcoord<96){color="#E36970";}
else if (xcoord<104){color="#C79E6B";}
else if (xcoord<112){color="#90BE00";}
else if (xcoord<120){color="#E16A96";}
else color="white";
}
// End Hiding -->
</SCRIPT>
</HEAD>

นำ Code ไปวางไว้ในส่วนของ <Body> หมายเหตุ : เปลี่ยนชื่อไฟล์ .html ตรงที่เป็นสีเขียวให้เป็นชื่อเดียวกับไฟล์ .html ของคุณเอง

<SCRIPT LANGUAGE="JavaScript">
<!-- Hide JavaScript from Java-Impaired Browsers
posx=locnm.indexOf(".x=");
if (posx>0) {
getCol();
}
else {
color="white";
}
document.bgColor=color;
// End Hiding -->
</SCRIPT>
<body bgcolor="#FFFFFF">
<FORM NAME='isnform' METHOD=GET ACTION='
backcolsam.html'>
<B class="Green">
Your Text Here </B>
<INPUT TYPE='image' SRC='
color.gif' NAME='color' BORDER=0 HEIGHT=8 WIDTH=128>
</FORM>

อย่าลืม Save ไฟล์ภาพสี (color.gif) ไปใช้งานด้วยนะครับ (คลิกขวาเลือก Save Picture As)

Top of PageBack to Previous Page

 
visit our sponsor
Free web template Learning Photoshop 6.0 Technic

Download Software Graphic webboard

Graphic and webdesign Links Website design service Contact Us