Kali ini saya ingin membagikan cara membuat judul blog bergerak pada browser. Untuk contohnya, silahkan lihat judul blog punya mampirbro di atas nav browser sobat yang ada tulisan "Assalamu'alaikum WR.WB. | Selamat datang di mampirbro...blog | Blog'a software gratisan | bla..bla..". Nah, yang seperti itulah yang akan kita buat sekarang. Bagi sobat yang mau memakai judul blog browser bergerak, silahkan lihat caranya dibawah ini.
caranya sangat mudah, cukup copy scriptcode dibawah ini dan pastekan pada gadget html blog sobat, gadgetnya tak perlu diberi nama.
<script language="JavaScript">
<!--
/*****TITLE START*****/
function tb5_makeArray(n){
this.length = n;
return this.length;
}
tb5_messages = new tb5_makeArray(5);
tb5_messages[0] = "Assalamualaikum WR.WB";
tb5_messages[1] = "Welcome in my blog";
tb5_messages[2] = "Selamat datang di blog saya";
tb5_messages[3] = "Blog berbagi ilmu dan sharing sesuatu";
tb5_messages[4] = "Sering-sering maen dimari ya!";
tb5_rptType = 'infinite';
tb5_rptNbr = 10;
tb5_speed = 50;
tb5_delay = 2000;
var tb5_counter=1;
var tb5_currMsg=0;
var tb5_stsmsg="";
function tb5_shuffle(arr){
var k;
for (i=0; i<arr.length; i++){
k = Math.round(Math.random() * (arr.length - i - 1)) + i;
temp = arr[i];arr[i]=arr[k];arr[k]=temp;
}
return arr;
}
tb5_arr = new tb5_makeArray(tb5_messages[tb5_currMsg].length);
tb5_sts = new tb5_makeArray(tb5_messages[tb5_currMsg].length);
for (var i=0; i<tb5_messages[tb5_currMsg].length; i++){
tb5_arr[i] = i;
tb5_sts[i] = "_";
}
tb5_arr = tb5_shuffle(tb5_arr);
function tb5_init(n){
var k;
if (n == tb5_arr.length){
if (tb5_currMsg == tb5_messages.length-1){
if ((tb5_rptType == 'finite') && (tb5_counter==tb5_rptNbr)){
clearTimeout(tb5_timerID);
return;
}
tb5_counter++;
tb5_currMsg=0;
}
else{
tb5_currMsg++;
}
n=0;
tb5_arr = new tb5_makeArray(tb5_messages[tb5_currMsg].length);
tb5_sts = new tb5_makeArray(tb5_messages[tb5_currMsg].length);
for (var i=0; i<tb5_messages[tb5_currMsg].length; i++){
tb5_arr[i] = i;
tb5_sts[i] = "_";
}
tb5_arr = tb5_shuffle(tb5_arr);
tb5_sp=tb5_delay;
}
else{
tb5_sp=tb5_speed;
k = tb5_arr[n];
tb5_sts[k] = tb5_messages[tb5_currMsg].charAt(k);
tb5_stsmsg = "";
for (var i=0; i<tb5_sts.length; i++)
tb5_stsmsg += tb5_sts[i];
document.title = tb5_stsmsg;
n++;
}
tb5_timerID = setTimeout("tb5_init("+n+")", tb5_sp);
}
function tb5_randomizetitle(){
tb5_init(0);
}
tb5_randomizetitle();
//-->
</script>
<!--
/*****TITLE START*****/
function tb5_makeArray(n){
this.length = n;
return this.length;
}
tb5_messages = new tb5_makeArray(5);
tb5_messages[0] = "Assalamualaikum WR.WB";
tb5_messages[1] = "Welcome in my blog";
tb5_messages[2] = "Selamat datang di blog saya";
tb5_messages[3] = "Blog berbagi ilmu dan sharing sesuatu";
tb5_messages[4] = "Sering-sering maen dimari ya!";
tb5_rptType = 'infinite';
tb5_rptNbr = 10;
tb5_speed = 50;
tb5_delay = 2000;
var tb5_counter=1;
var tb5_currMsg=0;
var tb5_stsmsg="";
function tb5_shuffle(arr){
var k;
for (i=0; i<arr.length; i++){
k = Math.round(Math.random() * (arr.length - i - 1)) + i;
temp = arr[i];arr[i]=arr[k];arr[k]=temp;
}
return arr;
}
tb5_arr = new tb5_makeArray(tb5_messages[tb5_currMsg].length);
tb5_sts = new tb5_makeArray(tb5_messages[tb5_currMsg].length);
for (var i=0; i<tb5_messages[tb5_currMsg].length; i++){
tb5_arr[i] = i;
tb5_sts[i] = "_";
}
tb5_arr = tb5_shuffle(tb5_arr);
function tb5_init(n){
var k;
if (n == tb5_arr.length){
if (tb5_currMsg == tb5_messages.length-1){
if ((tb5_rptType == 'finite') && (tb5_counter==tb5_rptNbr)){
clearTimeout(tb5_timerID);
return;
}
tb5_counter++;
tb5_currMsg=0;
}
else{
tb5_currMsg++;
}
n=0;
tb5_arr = new tb5_makeArray(tb5_messages[tb5_currMsg].length);
tb5_sts = new tb5_makeArray(tb5_messages[tb5_currMsg].length);
for (var i=0; i<tb5_messages[tb5_currMsg].length; i++){
tb5_arr[i] = i;
tb5_sts[i] = "_";
}
tb5_arr = tb5_shuffle(tb5_arr);
tb5_sp=tb5_delay;
}
else{
tb5_sp=tb5_speed;
k = tb5_arr[n];
tb5_sts[k] = tb5_messages[tb5_currMsg].charAt(k);
tb5_stsmsg = "";
for (var i=0; i<tb5_sts.length; i++)
tb5_stsmsg += tb5_sts[i];
document.title = tb5_stsmsg;
n++;
}
tb5_timerID = setTimeout("tb5_init("+n+")", tb5_sp);
}
function tb5_randomizetitle(){
tb5_init(0);
}
tb5_randomizetitle();
//-->
</script>
*Ganti kode berwarna merah dengan teks-teks sesuka hatimu.
Jika cara script diatas berhasil, maka secara otomatis title blog bergerak sudah muncul di browser sobat. Silahkan dipraktekkan sendiri sob.
Semoga berguna dan bermamfaat
Follow twitter saya ya (twitter.com/mampirbro), ntar saya follback
Salam MampirBro
Gunakan layanan 4shared generator (klik di sini ) untuk mempermudah mendonwload file dari 4shared tanpa perlu login.
mantap..ane suka blog ente gan penuh dengan ilmu, mampir gan ke http://jasafinance.blogspot.com
@jasafinance: thanks gan.
semoga berguna dan bermamfaat apa yang ada disini :)
htmlx di copy ke mana kok sya tdk mw sih
@NORYS TKJ tambah widget baru trus pilih html/javascrit. nah pada kolom html/javascript ini dicopas code javascript'a