Jika sobat tertarik untuk menciptakan cursor dengan text sendiri, silahkan ikuti langkah-langkah berikut ini :
1. Masuk ke Blog
2. Klik Tab Tata Letak
3. Klik Tab Elemen Halaman
4. Klik Tambah Gadget
5. Klik pilhan HTML/JavaScript
6. Pastekan script di bawah ini ke kolom Konten
<script>
//mouse
//Circling text trail- Tim Tilton
//Website: http://www.tempermedia.com/
//Visit http://www.dynamicdrive.com for this script and more
function cursor_text_circleundefined){
// your message here
var msg='KATSUKI DAITO'.splitundefined'').reverseundefined).joinundefined'');
var font='Verdana,Arial';
var size=3; // up to seven
var color='#ff0000';
// This is not the rotation speed, its the reaction speed, keep low!
// Set this to 1 for just plain rotation w/out drag
var speed=.3;
// This is the rotation speed, set it negative if you want
// it to spin clockwise
var rotation=-.2;
// Alter no variables past here!, unless you are good
//---------------------------------------------------
var ns=undefineddocument.layers);
var ie=undefineddocument.all);
var dom=document.getElementById;
msg=msg.splitundefined'');
var n=msg.length;
var a=size*13;
var currStep=0;
var ymouse=0;
var xmouse=0;
var props="<font face="+font+" size="+size+" color="+color+">";
if undefinedie)
window.pageYOffset=0
// writes the message
if undefinedns){
for undefinedi=0; i < n; i++)
document.writeundefined'<layer name="nsmsg'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+msg[i]+'</font></center></layer>');
}
else if undefinedie||dom){
document.writeundefined'<div id="outer" style="position:absolute;top:0px;left:0px;z-index:30000;"><div style="position:relative">');
for undefinedi=0; i < n; i++)
document.writeundefined'<div id="iemsg'+undefineddom&&!ie? i:'')+'" style="position:absolute;top:0px;left:0;height:'+a+'px;width:'+a+'px;text-align:center;font-weight:normal;cursor:default">'+props+msg[i]+'</font></div>');
document.writeundefined'</div></div>');
}
undefinedns)?window.captureEventsundefinedEvent.MOUSEMOVE):0;
function Mouseundefinedevnt){
ymouse = undefinedns||undefineddom&&!ie))?evnt.pageY+20-undefinedwindow.pageYOffset):event.y; // y-position
xmouse = undefinedns||undefineddom&&!ie))?evnt.pageX+20:event.x-20; // x-position
}
if undefinedns||ie||dom)
undefinedns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
var y=new Arrayundefined);
var x=new Arrayundefined);
var Y=new Arrayundefined);
var X=new Arrayundefined);
for undefinedi=0; i < n; i++){
y[i]=0;
x[i]=0;
Y[i]=0;
X[i]=0;
}
var iecompattest=functionundefined){
return undefineddocument.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}
var makecircle=functionundefined){ // rotation properties
if undefinedie) outer.style.top=iecompattestundefined).scrollTop+'px';
currStep-=rotation;
for undefinedi=0; i < n; i++){ // makes the circle
var d=undefinedns)?document.layers['nsmsg'+i]:ie? iemsg[i].style:document.getElementByIdundefined'iemsg'+i).style;
d.top=y[i]+a*Math.sinundefinedundefinedcurrStep+i*1)/3.8)+window.pageYOffset-15+undefinedie||dom? 'px' : '');
d.left=x[i]+a*Math.cosundefinedundefinedcurrStep+i*1)/3.8)*2+undefinedie||dom? 'px' : ''); // remove *2 for just a plain circle, not oval
}
}
var drag=functionundefined){ // makes the resistance
y[0]=Math.roundundefinedY[0]+=undefinedundefinedymouse)-Y[0])*speed);
x[0]=Math.roundundefinedX[0]+=undefinedundefinedxmouse)-X[0])*speed);
for undefinedvar i=1; i < n; i++){
y[i]=Math.roundundefinedY[i]+=undefinedy[i-1]-Y[i])*speed);
x[i]=Math.roundundefinedX[i]+=undefinedx[i-1]-X[i])*speed);
}
makecircleundefined);
// not rotation speed, leave at zero
setTimeoutundefinedfunctionundefined){dragundefined);},10);
}
if undefinedns||ie||dom)
if undefined typeof window.addEventListener != "undefined" )
window.addEventListenerundefined "load", drag, false );
else if undefined typeof window.attachEvent != "undefined" )
window.attachEventundefined "onload", drag );
else {
if undefined window.onload != null ) {
var oldOnload = window.onload;
window.onload = function undefined e ) {
oldOnloadundefined e );
dragundefined);
};
}
else
window.onload = drag;
}
}
cursor_text_circleundefined);
</script>
7. Silahkan ganti tulisan berwarna merah dengan tulisan pilihan anda
8. Klik Simpan
9. Selesai
source : http://www.oktri.co.cc/2009/10/cursor-selalu-diikuti-oleh-text.html
1 komentar:
saya da cube,tp xboleh..npe ye ?
Posting Komentar