Pages

Ads 468x60px

Selasa, 24 November 2009

Membuat Link Pelangi

Dari nama pelangi yang dipergunakan, kiranya sudah cukup jelas arti judul di atas. Kalau pada umumnya link pada sebuah blog hanya berupa teks satu warna, dengan memanfaatkan javascript di bawah ini maka seluruh link yang terdapat dalam blog akan terlihat sebagai teks dengan warna yang berubah-ubah seperti warna-warna pelangi.

Cara membuat link pelangi :

1. Amankan template terlebih dahulu dengan cara :

Login ke Blogger --> Tata Letak --> Edit HTML -->

Download Template Lengkap --> Simpan di Folder PC

2. Copy KODE berikut dan tempatkan pada bagian head di atas ]]></b:skin>



<script type="text/javascript">
/* Shannenpio Demo/shannenpio.blogspot.com*/
bname=navigator.appName;
bversion=parseInt(navigator.appVersion)
var z=0;
var rgb=0;
var message= new Array();
var value=0;
var timer1;
var timer2;
var timer3;
var convert = new Array()
var hexbase= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F");
//Do not edit anything else in the Script except the lines below
var bgcolor="#FF0000"; //Fade color
var color="#0000FF"; //Starting color
var speed=55
//Do not edit anything else in the Script except the lines above
for (x=0; x<16; x++){
for (y=0; y<16; y++){
convert[value]= hexbase[x] + hexbase[y];
value++;
}
}
redx=color.substring(1,3);
greenx=color.substring(3,5);
bluex=color.substring(5,7);
hred=eval(parseInt(redx,16));
hgreen=eval(parseInt(greenx,16));
hblue=eval(parseInt(bluex,16));
eredx=bgcolor.substring(1,3);
egreenx=bgcolor.substring(3,5);
ebluex=bgcolor.substring(5,7);
ered=eval(parseInt(eredx,16));
egreen=eval(parseInt(egreenx,16));
eblue=eval(parseInt(ebluex,16));
red=ered;
green=egreen;
blue=eblue;
function start(){
timer1=window.setInterval('up()',speed)
}
function up(){
if (red<hred){
if ((red+15)<hred){
red+=15;
redx = convert[red]
}
else{
red=hred
redx = convert[red]
}
}
if (red>hred){
if ((red-15)>hred){
red-=15;
redx = convert[red]
}
else{
red=hred
redx = convert[red]
}
}
if (green<hgreen){
if ((green+15)<hgreen){
green+=15;
greenx = convert[green]
}
else{
green=hgreen
greenx = convert[green]
}
}
if (green>hgreen){
if ((green-15)>hgreen){
green-=15;
greenx = convert[green]
}
else{
green=hgreen
greenx = convert[green]
}
}
if (blue<hblue){
if ((blue+15)<hblue){
blue+=15;
bluex = convert[blue]
}
else{
blue=hblue
bluex = convert[blue]
}
}
if (blue>hblue){
if ((blue-15)>hblue){
blue-=15;
bluex = convert[blue]
}
else{
blue=hblue
bluex = convert[blue]
}
}
rgb = "#"+redx+greenx+bluex;
document.linkColor=rgb;
document.vlinkColor=rgb;
if (z>19){
window.clearInterval(timer1);
timer2=window.setInterval('down()',speed)
}
else
z++
}
function down(){
if (red<ered){
if ((red+15)<ered){
red+=15;
redx = convert[red]
}
else{
red=ered
redx = convert[red]
}
}
if (red>ered){
if ((red-15)>ered){
red-=15;
redx = convert[red]
}
else{
red=ered
redx = convert[red]
}
}
if (green<egreen){
if ((green+15)<egreen){
green+=15;
greenx = convert[green]
}
else{
green=egreen
greenx = convert[green]
}
}
if (green>egreen){
if ((green-15)>egreen){
green-=15;
greenx = convert[green]
}
else{
green=egreen
greenx = convert[green]
}
}
if (blue<eblue){
if ((blue+15)<eblue){
blue+=15;
bluex = convert[blue]
}
else{
blue=eblue
bluex = convert[blue]
}
}
if (blue>eblue){
if ((blue-15)>eblue){
blue-=15;
bluex = convert[blue]
}
else{
blue=eblue
bluex = convert[blue]
}
}
rgb = "#"+redx+greenx+bluex;
document.linkColor=rgb;
document.vlinkColor=rgb;
if (z>38){
z=0;
window.clearInterval(timer2);
timer1=window.setInterval('up()',speed);
}
else
z++
}
</script>



3. Ganti KODE <body> dengan KODE <body onLoad="start()">

4. Simpan Template.

5. Buka blog untuk melihat hasilnya.

Catatan :

- Untuk mempermudah pencarian KODE ]]></b:skin> dan <body> , KLIK secara bersamaan Ctrl+F

0 komentar:

Posting Komentar