script di atas bisa kita fungsikan untuk menampilkan informasi-informasi dari blog kita atau bisa juga sebagai bunner :D heheheh
scriptnya seperti ini :
<script language="JavaScript">
<!-- Begin
var CurrentMsg = 'hello ';
function update(msg) {
var pad_str="";
n = msg.length;
if(n<72) {
pad = (73-n)/2;
for(var i=0; i<pad; i++) {
pad_str+=" ";
}
}
CurrentMsg = pad_str + msg;
document.messages.field.value = CurrentMsg;
clearTimeout(timer);
timer = setTimeout("idleMsg()",4000);
}
function MakeArray(n) {
this.length=n;
for(var i = 1; i<= n; i++) {
this[i] = "";
}
return(this);
}
var index = 1;
var notice_num = 10;
var notices = new MakeArray(notice_num);
notices[1] = "Welcome to boeginese";
notices[2] = "mau buat yang seperti ini.?";
notices[3] = "heheheh..gampang...";
notices[4] = "ntar gua kasi kodenya.";
notices[5] = "thanks yah atas kunjunganya";
notices[6] = "smoga bermanfaat";
notices[7] = "Well, take this script, and let me know how it turns out.";
notices[8] = "I forget to mention you can change the text and the speed -";
notices[9] = "Just change (\"idleMsg()\",4000) to the speed you want.";
notices[10] = "Be sure to remember that the time is in milliseconds! Repeating....";
var timer = setTimeout('idleMsg()',4000);
function nochange() {
document.messages.field.value = CurrentMsg;
}
function idleMsg() {
update(notices[index++]);
if(index>notice_num) {
index=1;
}
}
// End -->
</script>
text yang berwarnah merah bisa di ganti dengan kata-kata yang ingin di tampilkan
silahkan di coba sendiri
Tidak ada komentar:
Posting Komentar