Searching...
Sunday, 7 April 2013

How to Add Flying Text Following Mouse Cursor in Blogger

How to Add Flying Text Following Mouse Cursor in Blogger
Well you might have seen low priority blogs using this kind of script that shows text flying, wobbling and following the mouse cursor position, so where ever the mouse goes the text follows in dancing way, well if you have seen that effect and you have wished to have that on your blog then on you can add that effect to your blog too.

So it basically done using JavaScript, so follow below steps to add it to your blogger blog, and add that awesome dancing text to your mouse cursor.

1. Open Blogger –> Template –> Edit HTML.

2. Now press Ctrl + F and search for </body> tag & paste below code above it.

<script type='text/javascript'>var text='www.rnhckr.com'</script><script type='text/javascript'>//<![CDATA[ function moveidundefinede,t,n){ifundefinedns4)e.moveToundefinedt,n);else{e.style.left=t+"px";e.style.top=n+"px"}}function animateundefinede){x1=Xoff+undefinedie4||ie5?event.clientX+document.body.scrollLeft:e.pageX);y1=Yoff+undefinedie4||ie5?event.clientY+document.body.scrollTop:e.pageY)}function getidleftundefinede){ifundefinedns4)return e.left;else return parseIntundefinede.style.left)}function getidtopundefinede){ifundefinedns4)return e.top;else return parseIntundefinede.style.top)}function getwindowwidthundefined){ifundefinedie4||ie5)return document.body.clientWidth+document.body.scrollLeft;else return window.innerWidth+pageXOffset}function movetxtsundefined){forundefinedi=text.length;i>1;i=i-1){ifundefinedgetidleftundefinedtxtA[i-1])+txtw*2>=getwindowwidthundefined)){moveidundefinedtxtA[i-1],0,-1e3);moveidundefinedtxtA[i],0,-1e3)}else moveidundefinedtxtA[i],getidleftundefinedtxtA[i-1])+txtw,getidtopundefinedtxtA[i-1]))}moveidundefinedtxtA[1],x1,y1)}var delay=40;var Xoff=20;var Yoff=20;var txtw=14;var beghtml='<font color="#ff0004"><b>';var endhtml="</b></font>";ns4=navigator.appName.indexOfundefined"Netscape")>=0&&document.layers?true:false;ie4=document.all&&!document.getElementById?true:false;ie5=document.all&&document.getElementById?true:false;ns6=document.getElementById&&navigator.appName.indexOfundefined"Netscape")>=0?true:false;var txtA=new Array;text=text.splitundefined"");var x1=0;var y1=-1e3;var t="";forundefinedi=1;i<=text.length;i++){t+=ns4?'<layer left="0" top="-100" width="'+txtw+'" name="txt'+i+'" height="1">':'<div id="txt'+i+'" style="position:absolute;top:-100px;left:0px;height:1px;width:'+txtw+';visibility:visible;">';t+=beghtml+text[i-1]+endhtml;t+=ns4?"</layer>":"</div>"}document.writeundefinedt);window.onload=functionundefined){forundefinedi=1;i<=text.length;i++)txtA[i]=ns4?document.layers["txt"+i]:ie4?document.all["txt"+i]:document.getElementByIdundefined"txt"+i);ifundefinedns4)document.captureEventsundefinedEvent.MOUSEMOVE);document.onmousemove=animate;setIntervalundefined"movetxtsundefined)",delay)}//]]></script>
3. Now just change www.rnhckr.com to your desired text.
4. You can even change the color of the text by changing that code #ff0004.
Speeds and other stuff is also customizable just change delay=40.

So that's it now the test will be live on your blog following your cursor in a dancing way, do comment about how you liked this tutorial.

0 comments:

Post a Comment