-->
สวัสดีครับ

วันจันทร์ที่ 2 กรกฎาคม พ.ศ. 2555

การทำแถบเลื่อนลงตาม scorll bar

1. สร่าง Gadget ใหม่
2. เลือกเป็น HTML/จาวาสคริปท์
3. ก็อปโค๊ดด้านล่างลงไป








<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#apDiv1 {
position:fixed;
width:100%;
height:55px;
z-index:1;
background-color: #F30;
left: 0px;
right: 0px;
bottom: 0px;
top: 1px;
}
body {
margin-left: 100px;
margin-right: 3px;
margin-bottom: 50px;
margin-top: 50px;
background-color: #FFF <<สีของแถบ ใส่เป็นโค๊ดสี ;
}
</style>


</head>


<body>
<div id="apDiv1">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
  <style type="text/css">
<!--
body {
margin-left: 190px;
margin-top: 40px;
margin-right: 0px;
margin-bottom: 0px;

}
body,td,th {
font-family: Tahoma;
font-size: 12px;
color: #FAFCFE << สีของตัวอักษร เวลาใส่ให้ใส่เป็น โค้ดสี ;
font-weight: bold;
}
.color_red {
font-family: Tahoma;
font-size: 14px;
font-weight: bold;
color: #FAFCFE;
}
-->
</style>
<div class="color_red" id="noticscroll" style="width:915px;background-color:transparent; border-style: none; margin-left: 500px; margin-top:20px; text-align:left;">...</div>
<script type="text/javascript">
<!-- begin
var max=0;
function textlist()
{
max=textlist.arguments.length; for (i=0; i<max; i++) this[i]=textlist.arguments[i];
}
tl=new textlist
(
"พิมพ์ข้อความของคุณที่นี่",
"พิมพ์ข้อความของคุณที่นี่",
"พิมพ์ข้อความของคุณที่นี่"
);
var x=0; pos=0;
function getRandom(rmin, rmax)
{
var randomNum = Math.random() * (rmax-rmin);
// Round to the closest integer and return it
return(Math.round(randomNum) + rmin);
}
x = getRandom(0,max-1);
var l=tl[x].length;
function textticker()
{
document.getElementById("noticscroll").innerHTML = tl[x].substring(0,pos)+"_";
if(pos++==l)
{
pos=0;
setTimeout("textticker()",4000);
x++;
if(x==max)
x=0;
l=tl[x].length;
} else
setTimeout("textticker()",60<<<เวลาแก้ให้ลบ<ด้วย ยิ่งตัวเลขมากยิ่งช้า);
}


textticker();
// end -->
</script>
</body>
</html>




4. วางโค๊ดนี้ลงไป แก้ไขส่วนที่ให้พิมพ์ข้อความ
(หากแก้ไขมั่วๆอาจทำให้สคริปท์ที่เขียนนั้นไม่แสดง)
5. คลิ๊กที่ปุ่ม 'บันทึก'
6. เป็นอันจบครับ อย่าลืมไปดูบล็อกของตัวเองด้วยละครับ !!
****หมายเหตุ เวลาแก้สคริปท์ความเร็ว + สีตัวอักษร ให้ลบเครื่องหมายนี้ด้วย '<<' ที่สำคัญ ส่วนตรงที่ให้ใส่โค้ดสรให้หาจาก Google หรือ เว็บนี้ หาสีที่ถูกใจแล้วเลือกลงมาใส่ ในส่วนที่จัดให้ พอใส่เสร็จแล้วก็บันทึกแล้วลองดูเว็บตัวเองว่า Ok หรือปล่าว**** 

ไม่มีความคิดเห็น:

แสดงความคิดเห็น