<script> function setColor(){ var cbody =document.getElementById('bodyColor').value; var imgbody =document.getElementById('bodyImgs').value; var repBody = getCheckedValue(document.setTheme.repBodyImgs); var cblock=document.getElementById('blockColor').value; var imgblock =document.getElementById('blockImgs').value; var repBlock = getCheckedValue(document.setTheme.repBlockImgs); if(cbody=="other") cbody=document.getElementById('otherBodyColor').value; if(cblock=="other") cblock=document.getElementById('otherBlockColor').value; document.getElementsByTagName('body')[0].style.background =cbody+" url("+imgbody+") "+repBody+" left top"; document.getElementById('block').style.background=cblock+" url("+imgblock+") "+repBlock+" left top"; } function createTextbox(box,val){ var tep= document.getElementById(box); if(val=="other"){ tep.innerHTML = 'ใส่รหัสสีที่ต้องการ<input type="text" id="'+box+'Color" value="#"/>' }else{ tep.innerHTML =""; } } function getCheckedValue(radioObj) { if(!radioObj) return ""; var radioLength = radioObj.length; if(radioLength == undefined) if(radioObj.checked) return radioObj.value; else return ""; for(var i = 0; i < radioLength; i++) { if(radioObj[i].checked) { return radioObj[i].value; } } return ""; } </script> <style> body{ background:#FFFFFF ; } #block{ height:200px; background:#FF0066 } </style> <body> <div id=block> นี่คือ block </div> <form name="setTheme"> <b>Body</b><br/> <u>รูป:</u><br/> <input type="text" id="bodyImgs"> ใส่ url <br/> <u>Repeat:</u><br/> <input type="radio" name="repBodyImgs" id="repBodyImgs" value="repeat" checked>repeat xy <input type="radio" name="repBodyImgs" id="repBodyImgs" value="repeat-x">repeat x <input type="radio" name="repBodyImgs" id="repBodyImgs" value="repeat-y">repeat y <br/> <u>color:</u><br/> <select id="bodyColor" onchange="javascript:createTextbox('otherBody',this.value)"> <option value="red">Red</option> <option value="blue">blue</option> <option value="black">Black</option> <option value="other" >Other</option> </select> <span id="otherBody"></span><br/><br/> <b>Block</b><br/> <u>รูป:</u><br/> <input type="text" id="blockImgs"> ใส่ url <br/> <u>Repeat:</u><br/> <input type="radio" name="repBlockImgs" id="repBlockImgs" value="repeat" checked>repeat xy <input type="radio" name="repBlockImgs" id="repBlockImgs" value="repeat-x">repeat x <input type="radio" name="repBlockImgs" id="repBlockImgs" value="repeat-y">repeat y <br/> color:<select id="blockColor" onchange="javascript:createTextbox('otherBlock',this.value)"> <option value="red">Red</option> <option value="blue">blue</option> <option value="black">Black</option> <option value="other" >Other</option> </select> <span id="otherBlock"></span><br/> <input type="button" value="ok" onclick="javascript:setColor()"> </form> </body>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง