It's free and you have access to premium codes!
Welcome back! Please login to your account.
Don't worry, we'll send you a message to help you to recover your acount.
Please check your email for instructions to activate your account.
Written by 21 August 2012
This is a kind of effect on text to set it in the right of the pointer in the wind blow.
<!-- this script is provided by https://www.javascriptfreecode.com coded by: Kerixa Inc. -->
<style type="text/css">
</style>
<script language="JavaScript1.2">
var x,y
var kern=20
var flag=0
var message="welcome to my weblog"
message=message.split("")
var xpos=new Array()
for (i=0;i<message.length;i++) {
xpos[i]=-50
}
var ypos=new Array()
for (i=0;i<message.length;i++) {
ypos[i]=-50
}
function handlerMM(e){
x = (e) ? e.pageX : document.body.scrollLeft+event.clientX
y = (e) ? e.pageY : document.body.scrollTop+event.clientY
flag=1
}
function makebanner() {
if (flag==1) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+kern
ypos[i]=ypos[i-1]
}
xpos[0]=x+kern
ypos[0]=y
for (i=0; i<message.length; i++) {
if (document.getElementById) {
var thisspan = document.getElementById("span"+i).style
} else {
var thisspan = eval((document.layers)?"document.span"+i:"span"+(i)+".style")
}
if (thisspan.posLeft) {
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]
}
if (!thisspan.posLeft) {
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
}
}
var timer=setTimeout("makebanner()",30)
}
window.onload=makebanner;
</script>
<script language="JavaScript1.2">
for (i=0;i<message.length;i++) {
document.write("<span id='span"+i+"' class='spanstyle'>")
document.write(message[i])
document.write("</span>")
}
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;
</script>
<style type="text/css">
<!--
.spanstyle {
position:absolute;
visibility:visible;
top:-50px;
font-size:10pt;
font-family:Verdana;
font-weight:italic;
color:808066;
}
BODY {
width:100%;overflow-x:hidden;overflow-y:scroll;
}
-->
</style>
<script language="JavaScript1.2">
var x,y
var kern=20
var flag=0
var message="welcome to my weblog"
message=message.split("")
var xpos=new Array()
for (i=0;i<message.length;i++) {
xpos[i]=-50
}
var ypos=new Array()
for (i=0;i<message.length;i++) {
ypos[i]=-50
}
function handlerMM(e){
x = (e) ? e.pageX : document.body.scrollLeft+event.clientX
y = (e) ? e.pageY : document.body.scrollTop+event.clientY
flag=1
}
function makebanner() {
if (flag==1) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+kern
ypos[i]=ypos[i-1]
}
xpos[0]=x+kern
ypos[0]=y
for (i=0; i<message.length; i++) {
if (document.getElementById) {
var thisspan = document.getElementById("span"+i).style
} else {
var thisspan = eval((document.layers)?"document.span"+i:"span"+(i)+".style")
}
if (thisspan.posLeft) {
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]
}
if (!thisspan.posLeft) {
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
}
}
var timer=setTimeout("makebanner()",12)
}
window.onload=makebanner;
</script>
<script language="JavaScript1.2">
for (i=0;i<message.length;i++) {
document.write("<span id='span"+i+"' class='spanstyle'>")
document.write(message[i])
document.write("</span>")
}
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;
</script></body>
</html>
<a target='_blank' href='https://www.javascriptfreecode.com' style='font-size: 8pt; text-decoration: none'>JavaScript Best Codes</a>
Comments
Here you can leave us commments. Let us know what you think about this code tutorial!