Cara membuat teks mengikuti cusor. menarik kan?makanya ikuti ya.
1.masuk ke blog kalian.
2.pergi ke tataletak
3.pilih tambah gadget terus klik HTML/JavaScript
4.copy paste code dibawah ini :
<em><script><br />
//mouse<br />
//Circling text trail- Tim Tilton<br />
//Website: http://www.tempermedia.com/<br />
//Visit http://www.dynamicdrive.com for this script and more<br />
function cursor_text_circle(){<br />
// your message here<br />
var msg='@TEKS ANDA@'.split('').reverse().join('');<br />
<br />
var font='Verdana,Arial';<br />
var size=3; // up to seven<br />
var color='#ff0000';<br />
<br />
// This is not the rotation speed, its the reaction speed, keep low!<br />
// Set this to 1 for just plain rotation w/out drag<br />
var speed=.3;<br />
<br />
// This is the rotation speed, set it negative if you want<br />
// it to spin clockwise<br />
var rotation=-.2;<br />
<br />
// Alter no variables past here!, unless you are good<br />
//---------------------------------------------------<br />
<br />
<br />
var ns=(document.layers);<br />
var ie=(document.all);<br />
var dom=document.getElementById;<br />
msg=msg.split('');<br />
var n=msg.length;<br />
var a=size*13;<br />
var currStep=0;<br />
var ymouse=0;<br />
var xmouse=0;<br />
var props="<font face="+font+" color="+color+" size="+size+">";<br />
<br />
if (ie)<br />
window.pageYOffset=0<br />
<br />
// writes the message<br />
if (ns){<br />
for (i=0; i < n; i++)<br />
document.write('<layer left="0" top="0" width="+a+" name="nsmsg'+i+'"
height="+a+"><center>'+props+msg[i]+'</font></center></layer>');<br
/>
}<br />
else if (ie||dom){<br />
document.write('<div id="outer"
style="position:absolute;top:0px;left:0px;z-index:30000;"><div
style="position:relative">');<br />
for (i=0; i < n; i++)<br />
document.write('<div id="iemsg'+(dom&&!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>');<br
/>
document.write('</div></div>');<br />
}<br />
(ns)?window.captureEvents(Event.MOUSEMOVE):0;<br />
<br />
function Mouse(evnt){<br />
ymouse = (ns||(dom&&!ie))?evnt.pageY+20-(window.pageYOffset):event.y; // y-position<br />
xmouse = (ns||(dom&&!ie))?evnt.pageX+20:event.x-20; // x-position<br />
}<br />
<br />
if (ns||ie||dom)<br />
(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;<br />
var y=new Array();<br />
var x=new Array();<br />
var Y=new Array();<br />
var X=new Array();<br />
for (i=0; i < n; i++){<br />
y[i]=0;<br />
x[i]=0;<br />
Y[i]=0;<br />
X[i]=0;<br />
}<br />
<br />
var iecompattest=function(){<br />
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;<br />
}<br />
<br />
var makecircle=function(){ // rotation properties<br />
if (ie) outer.style.top=iecompattest().scrollTop+'px';<br />
currStep-=rotation;<br />
for (i=0; i < n; i++){ // makes the circle<br />
var d=(ns)?document.layers['nsmsg'+i]:ie? iemsg[i].style:document.getElementById('iemsg'+i).style;<br />
d.top=y[i]+a*Math.sin((currStep+i*1)/3.8)+window.pageYOffset-15+(ie||dom? 'px' : '');<br />
d.left=x[i]+a*Math.cos((currStep+i*1)/3.8)*2+(ie||dom? 'px' : ''); // remove *2 for just a plain circle, not oval<br />
}<br />
}<br />
<br />
var drag=function(){ // makes the resistance<br />
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);<br />
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);<br />
for (var i=1; i < n; i++){<br />
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);<br />
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);<br />
<br />
}<br />
makecircle();<br />
// not rotation speed, leave at zero<br />
setTimeout(function(){drag();},10);<br />
}<br />
if (ns||ie||dom)<br />
if ( typeof window.addEventListener != "undefined" )<br />
window.addEventListener( "load", drag, false );<br />
else if ( typeof window.attachEvent != "undefined" )<br />
window.attachEvent( "onload", drag );<br />
else {<br />
if ( window.onload != null ) {<br />
var oldOnload = window.onload;<br />
window.onload = function ( e ) {<br />
oldOnload( e );<br />
drag();<br />
};<br />
}<br />
else<br />
window.onload = drag;<br />
}<br />
<br />
}<br />
cursor_text_circle();<br />
<br />
</script></em>
5.Hapus kode yang sudah kalian copy tadi yang bertuliskan @TEKS ANDA@ dan ganti dengan teks yang akan anda ketik atau ditampilkan
6.selesai
sumber : jackcrausher.blogspot.com
Search ? Here
Sabtu, 03 Maret 2012
Langganan:
Posting Komentar (Atom)
Popular Posts
-
Portgas D. Ace View source History Ahoy! This here is the 136th Featured Article . ...
-
1) ... ya, ichigo adalah pemeran utama... juga, dia berusaha meperbaiki/memperkuat dirinya. juga mempunyai kekuatan vizard 2) ... Aizen, d...
-
Kabuto Yakushi Edit this page edit Kabuto Yakushi [1] [2] [3] (薬師カブト, Yakus...
Tidak ada komentar:
Posting Komentar