ภาษาไทย
<!-- bbs http://www.downcodes.com/bbs--> <!-- 把下列代码加到<body>区域内 --> <SCRIPT> // javascript เพิ่มเติมจาก http://www. downcodes.com // URL ของสไลด์ var slideurl=new Array("/img/200406301.jpg", "/img/200406302.jpg", "/img/200406303.jpg", "/img/200406304.jpg") // ความคิดเห็นที่แสดงใต้สไลด์ var slidecomment=new Array("Mary", "Jane", "Rita", "Tina") // ลิงก์สำหรับแต่ละสไลด์ var slidelink=new Array("http://www.downcodes. com", "http://www.downcodes.com", "http://www.downcodes.com", "http://www.downcodes.com") // เป้าหมายของลิงก์ ค่าที่อนุญาต: "_parent", "_top", "_blank", "_self" var slidetarget=new Array("_blank", "_blank", "_blank", "_blank") // ความกว้างของสไลด์โชว์ (พิกเซล) var scrollerwidth=160 // ความสูงของสไลด์โชว์ (พิกเซล) var scrollerheight=100 // ความกว้างของโซนโปร่งใส (พิกเซล) var translayerszone=40 // แอตทริบิวต์แบบอักษรสำหรับความคิดเห็น var slidefont="Arial" var slidefontcolor=" blue" var slidefontsize="2" // สีพื้นหลังของหน้าเว็บ var pagebgcolor="#FFFFFF" // อย่าแก้ไขด้านล่างบรรทัดนี้ var translayerswidth=1 var translayersmax=Math.floor(translayerszone/translayerswidth) var translayersleftpos=0 var translayersopacity=100 var translayersfactor=100/translayersmax var translayerswidthall=translayersmax*translayerswidth var allpicturewidth var Distancepictopic=0 var scrollerleft=0 var scrollertop=0 var หยุดชั่วคราว = 20 var step=2 var newstep=ขั้นตอน var clipleft, clipright, cliptop, clipbottom var i_picture=0 var timer var picturecontent="" var ns4=document.layers?1:0 var ns6=document.getElementById&&!document.all?1:0 var ie=document.all?1:0 var browserinfos=navigator.userAgent var opera=browserinfos.match(/Opera/) var preloadedimages=new Array() สำหรับ (i=0;i<slideurl.length;i++){ preloadedimages[i]=new Image() preloadedimages[i].src=slideurl [i] } ฟังก์ชั่น init() { ถ้า (เช่น) { allpicturewidth=document.all.picturediv.offsetWidth document.all.picturediv.style.posTop=scrollertop document.all.picturediv.style.posLeft=scrollerleft+scrollerwidth clipleft=0 clipright=0 cliptop=0 clipbottom=scrollerheight document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" document.all.picturediv.style.visibility= "visible" scrollpicture() } if (ns6) { allpicturewidth=document.getElementById('emptypicturediv').offsetWidth document.getElementById('picturediv').style.top=scrollertop document.getElementById('picturediv').style.left =scrollerleft+scrollerwidth clipleft=0 clipright=0 cliptop=0 clipbottom=scrollerheight document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" document.getElementById('picturediv').style.visibility="visible" scrollpicture() } ถ้า (ns4) { allpicturewidth=document.roof.document.picturediv.document.width document.roof.document.picturediv.top=scrollertop document .roof.document.picturediv.left=scrollerleft+scrollerwidth document.roof.document.picturediv.clip.left=0 document.roof.document.picturediv.clip.right=0 document.roof.document.picturediv.clip.top= 0 document.roof.document.picturediv.clip.bottom=scrollerheight document.roof.document.picturediv.visibility="visible" scrollpicture() } } ฟังก์ชั่น scrollpicture() { if (ie) { if (document.all.picturediv. style.posLeft>=scrollerleft-allpicturewidth) { document.all.picturediv.style.posLeft-=step clipright+=step if (clipright>scrollerwidth) { clipleft+=step } document.all.picturediv.style.clip ="rect(" +cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" var timer=setTimeout("scrollpicture()",pause) } else { รีเซ็ตตำแหน่ง() } } if (ns6) { if (parseInt(document.getElementById ('picturediv').style.left)>=scrollerleft-allpicturewidth) { document.getElementById('picturediv').style.left=parseInt(document.getElementById('picturediv').style.left)-ขั้นตอน clipright+=step ถ้า (clipright> scrollerwidth) { clipleft+=step } document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" var timer=setTimeout( "scrollpicture()",pause) } else { รีเซ็ตตำแหน่ง() } } if (ns4) { if (document.roof.document.picturediv.left>=scrollerleft-allpicturewidth) { document.roof.document.picturediv.left-= ขั้นตอน document.roof.document.picturediv.clip.right+=step if (document.roof.document.picturediv.clip.right>scrollerwidth) { document.roof.document.picturediv.clip.left+=step } var timer=setTimeout( "scrollpicture()",pause) } else { รีเซ็ตตำแหน่ง() } } } ฟังก์ชัน onmsover() { step=0 } ฟังก์ชัน onmsout() { step=newstep } ฟังก์ชันรีเซ็ตตำแหน่ง() { if (ie) { document.all.picturediv .style.posLeft=scrollerleft+scrollerwidth clipleft=0 clipright=0 document.all.picturediv.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" scrollpicture() } ถ้า (ns6) { allpicturewidth=document.getElementById('emptypicturediv').offsetWidth document.getElementById('picturediv').style.left=scrollerleft+scrollerwidth clipleft=0 clipright=0 document.getElementById('picturediv').style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")" scrollpicture() } ถ้า (ns4) { document.roof.document.picturediv.left=scrollerleft+scrollerwidth document.roof.document. picturediv.clip.left=0 document.roof.document.picturediv.clip.right=0 scrollpicture() } } picturecontent="" picturecontent+="<table cellpadding=2 cellspacing=0>" picturecontent+="<tr>" สำหรับ (i=0;i<=slideurl.length-1;i++) { picturecontent+="<td>" picturecontent+="<a href=""+slidelink[i]+"" target=""+slidetarget [i]+"" onMouseOver="javascript:onmsover()" onMouseOut="javascript:onmsout()">" picturecontent+="<img src=""+slideurl[i]+"" border=0></a>" picturecontent+="</td>" } picturecontent+="</tr>" picturecontent+="<tr>" สำหรับ (i=0;i<=slideurl.length-1;i++) { picturecontent+="<td>" picturecontent+="<font face=""+slidefont+"" color=""+slidefontcolor+"" size="+slidefontsize+">" picturecontent+=slidecomment[i] picturecontent+=" </font>" picturecontent+="</td>" } picturecontent+="</tr>" picturecontent+="</tr></table>" ถ้า (เช่น || ns6) { document.write('<div style="position:relative;width:'+scrollerwidth+'px;height:'+scrollerheight+'px;overflow:hidden">') document.write('<div id=" picturediv" style="position:absolute;top:0px;left:0px;height:'+scrollerheight+'px;visibility:hidden">'+picturecontent+'</div>') ถ้า (เช่น && !opera) { สำหรับ ( i=0;i<=translayersmax;i++) { document.write('<span ID="trans'+i+'" style="position:absolute;top:0px;left:'+translayersleftpos+'px;width:' +translayerswidth+'px;height:'+scrollerheight+'px;สีพื้นหลัง:'+pagebgcolor+';filter:alpha(opacity='+translayersopacity+');overflow:hidden"> </span>') translayersleftpos+=translayerswidth translayersopacity- =translayersfactor } translayersleftpos=scrollerwidth-translayersleftpos สำหรับ (ii=0;ii<=translayersmax;ii++) { document.write('<span ID="trans'+ii+'" style="position:absolute;top:0px;left :'+translayersleftpos+'px;width:'+translayerswidth+'px;height:'+scrollerheight+'px;สีพื้นหลัง:'+pagebgcolor+';filter:alpha(opacity='+translayersopacity+');overflow:hidden"> < /span>') translayersleftpos+=translayerswidth translayersopacity+=translayersfactor } } if (ns6 && !opera) { สำหรับ (i=0;i<=translayersmax-1;i++) { document.write('<span ID="transleft'+ i+'" style="position:absolute;top:0px;left:'+translayersleftpos+'px;width:'+translayerswidth+'px;height:'+scrollerheight+'px;สีพื้นหลัง:'+pagebgcolor+';-moz- ความทึบ:'+translayersopacity/100+';overflow:hidden"> </span>') translayersleftpos+=translayerswidth translayersopacity-=translayersfactor if (translayersopacity<0) {translayersopacity=0.001} } translayersleftpos=scrollerwidth-translayersleftpos translayersopacity=0.001 สำหรับ ( i=0;i<=translayersmax-1;i++) { document.write('<span ID="transright'+i+'" style="position:absolute;top:0px;left:'+translayersleftpos+'px;width :'+translayerswidth+'px;height:'+scrollerheight+'px;พื้นหลัง-สี:'+pagebgcolor+';-moz-opacity:'+translayersopacity/100+';"> </span>') translayersleftpos+=translayerswidth translayersopacity+= translayersfactor } } document.write('</div>') document.write('<div id="emptypicturediv" style="position:absolute;top:0px;left:0px;height:'+scrollerheight+'px;การมองเห็น :hidden">'+picturecontent+'</div>') window.onload=init } if (ns4) { document.write('<ilayer name="roof" width='+scrollerwidth+' height='+scrollerheight+'> ') document.write('<layer name="picturediv" width='+scrollerwidth+' height='+scrollerheight+' allowance=hide>'+picturecontent+'</layer>') document.write('</ilayer>' ) window.onload=init } </script>