Cursor dengan bintang kelap-kelip

*
*
*
*

Cara membuatnya

Dari Dashboard >> Design >> Edit HTML.


Penempatannya
dibawah <b:skin><![CDATA[
........
diatas ]]></b:skin>

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;
}


Penempatannya
dibawah <body>
........
diatas </body>

<div id="div1" class="s1">*</div>
<div id="div2" class="s2">*</div>
<div id="div3" class="s3">*</div>
<div id="div4" class="s4">*</div>

<script type='text/javascript'>
//<![CDATA[

/*
Script by Mike McGrath- http://website.lineone.net/~mike_mcgrath
*/

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>



Credit : Mike Mcgrath

Alhamdulillah

0 comments:


Posting Komentar


Creative Commons License
Cursor dengan bintang kelap-kelip by Nano Yulianto is licensed under a Creative Commons Attribution 3.0 Unported License.
Based on a work at http://nanoyulianto.blogspot.com/2011/01/cursor-dengan-bintang-kelap-kelip.html.
Permissions beyond the scope of this license may be available at http://nanoyulianto.blogspot.com/.