Here you can find a number of examples on Java Script.Please find the various kinds of examples listed on the right side of this site. If you don't find anything on Java Script then please write to us or leave a commnet. We are pleased to help and find the solution of your problem.

Javascript: Move Text Along with Mouse



<html>
<head>
<title>Move text with mouse</title>

<script language="JavaScript">
<!-- Begin
function blockError(){return true;}
window.onerror = blockError;
</script>

<style>
.spanstyle {
position:absolute;
visibility:visible;
top:-50px;
font-size:9pt;
font-family:verdana;
font-weight:bold;
color:darkblue;
}
</style>

<script language="javascript">
var x,y
var step=20
var flag=0

var message="Move text Along with Mousee"
message=message.split("")


var xpos=new Array()
for (i=0;i<=message.length-1;i++) {
xpos[i]=-50
}

var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
ypos[i]=-50
}

function handlerMM(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
flag=1
}

function makesnake() {
if (flag==1 && document.all) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y

for (i=0; i<message.length-1; i++) {
var thisspan = eval("span"+(i)+".style")
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]
}
}

else if (flag==1 && document.layers) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y

for (i=0; i<message.length-1; i++) {
var thisspan = eval("document.span"+i)
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
}
var timer=setTimeout("makesnake()",30)
}

</script>

</head>
<body onload="makesnake()" bgcolor="lightyellow" text="blue" link="#00FF00" alink="#00FF00">

<script>
<!-- Beginning of JavaScript -

for (i=0;i<=message.length-1;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>

15 comments:

  1. Thanks for your marvelous posting! I genuinely enjoyed reading it, you're a great author.I will ensure that I bookmark your blog and will come back later on. I want to encourage that you continue your great posts, have a nice day!

    Visit my web blog Christian Louboutin Flats

    ReplyDelete
  2. This info is priceless. Where can I find out more?

    Feel free to surf to my website: Christian Louboutin Slingbacks

    ReplyDelete
  3. I like the helpful info you provide in your articles.
    I'll bookmark your weblog and check again here regularly. I'm quite sure
    I will learn many new stuff right here! Good luck for the next!


    Here is my web page; Fake Oakley Sunglasses

    ReplyDelete
  4. Organic cold pressed Sunflower oil. This was the most highly regarded one when I
    researched it. Spectrum is a great brand.

    Feel free to visit my homepage: Dental Pro 7 Ebay

    ReplyDelete
  5. Russ,
    Love your blog! I just happened across it.
    ..

    Feel free to surf to my website; subliminal ways to attract women

    ReplyDelete
  6. Thanks for the suggestions. Singles populace is only
    a single aspect we regarded as in assessing leading metropolitan areas.
    As noted, work possibilities carried much more excess weight, as did expense of living.



    my blog post - Give in to a woman's whims

    ReplyDelete
  7. be glad that you're not forced collectivist dogma yet (don't
    worry, it will come). Community schooling? doesn't educate you the best way to think, it teaches you the way to be considered a follower on the authoritarian massive, bad Point out.

    Feel free to visit my website: 2gts 60 minute stamina download

    ReplyDelete
  8. I didn't know concerning the BOD POD until now, sounds extremely promising. I've received a scale at house that may also measure physique unwanted fat and muscle mass, but
    the outcomes are mostly inaccurate. I'd prefer to try the Bod Pod some time to get an exact measurement.

    Also visit my web page :: precision nutrition System review

    ReplyDelete
  9. I don't really coupon given that they may be usually for things I do not eat, or perhaps after i use the coupon the generic brand name continues to be less costly. At most I"ll have two coupons with me. My favourite coupons are the ones that Krogers mail out since they cater to your spending routines according to your Kroger furthermore card purchases.

    my web blog :: john berardi's precision nutrition lean eating program

    ReplyDelete
  10. Not working with me.. help me

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. replica bags in london replica hermes b4x71x1s42 replica bags china free shipping anonymous p4e31e5m99 replica ysl handbags replica bags and shoes replica bags hong kong Source z7x92a6z89 replica bags thailand

    ReplyDelete
  13. Learn More Here x1z27h7r90 gucci replica handbags replica bags philippines replica bags from china free shipping replica hermes bags e5x73r0w36 replica bags hermes This Site n7r92b8q60 replica louis vuitton replica bags prada g9h93o3j55

    ReplyDelete

Google