Subscribe
Facebook
FriendFeed
Twitter
Welcome to NewsFlash™
delete
*
*
*
*
*
Memuat berita...

Trik Membuat Animasi Kursor Bintang!!

Senin, 22 Juni 2009

starKursor animasi bintang?? ya.. coba sobat liat kursor di blog gw.. nah itulah animasi bintang hehehe~~ mau tau cara buatnya?? silahkan disimak yach ^_^



Sebelum memulai jangan lupa menyimpan templatenya secara penuh y! dengan cara

Layout---> Edit HTML---> Download Full Template

Letakkan kode CSS dibawah ini tepat diatas </head>

<style type="text/css">

BODY{
overflow-x:hidden;
}

.s1
{
position : absolute;
font-size : 10pt;
color : blue;
visibility: hidden;
}

.s2
{
position : absolute;
font-size : 18pt;
color : red;
visibility : hidden;
}

.s3
{
position : absolute;
font-size : 14pt;
color : gold;
visibility : hidden;
}

.s4
{
position : absolute;
font-size : 12pt;
color : lime;
visibility : hidden;
}

.s5
{
position : absolute;
font-size : 16pt;
color : yellow;
visibility : hidden;
}

</style>

NB: kode css bisa sobat modifikasi sesuai keinginan ^_^

Kemudian letakkan javascript juga diatas kode </head>

<script type="text/javascript">

var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes

var nav = (!document.all || window.opera);
var tmr = null;
var spd = 50;
var x = 0;
var x_offset = 5;
var y = 0;
var y_offset = 15;

document.onmousemove = get_mouse;

function get_mouse(e)
{
x = (nav) ? e.pageX : event.clientX+standardbody.scrollLeft;
y = (nav) ? e.pageY : event.clientY+standardbody.scrollTop;
x += x_offset;
y += y_offset;
beam(1);
}

function beam(n)
{
if(n<5)
{
document.getElementById('div'+n).style.top=y+'px'
document.getElementById('div'+n).style.left=x+'px'
document.getElementById('div'+n).style.visibility='visible'
n++;
tmr=setTimeout("beam("+n+")",spd);
}
else
{
clearTimeout(tmr);
fade(4);
}
}

function fade(n)
{
if(n>0)
{
document.getElementById('div'+n).style.visibility='hidden'
n--;
tmr=setTimeout("fade("+n+")",spd);
}
else clearTimeout(tmr);
}
</script>


nah langkah terakhir letakkan kode berikut dibawah <body>

<DIV CLASS='s1' ID='div1'>*</DIV>
<DIV CLASS='s2' ID='div2'>*</DIV>
<DIV CLASS='s3' ID='div3'>*</DIV>
<DIV CLASS='s4' ID='div4'>*</DIV>
<DIV CLASS='s5' ID='div5'>*</DIV>


jangan lupa disimpan templatenya >.<

Abis Baca Jangan Lupa Komentarnya Y Sobat!