PDA

View Full Version : Cursor Trailer Text Script



moonifa
07-01-2005, 03:10 PM
Please don't laugh but I recently decided to try and learn HTML, scripts, etc as best I could on my own.

I have a website at http://www.moonifasgarden.bravehost.com which is a free site with wizards that "do it all for you".

I finally got up the courage to try and use the Cursor Trailer Text script located at http://www.dynamicdrive.com/dynamicindex13/trailortext.htm. ( It only took me several days to figure out where I needed to go to use the script LOL)

If you go to my website you will see the problem I have having better than I can describe it here. LOL

Would someone please tell me what the heck I am doing wrong? :confused: I do so appreciate your time and expertise. Thank You! Moonifa (Rachel)

oliverlong
07-01-2005, 04:02 PM
Hey Moonifa,

What you have there doesn't look to bad at all.
I can not promise you that this will fix this problem but you need to clean up the html a bit. If you look at the html on your page you will see:

<body onLoad="makesnake()" style="width:100%;overflow-x:hidden;overflow-y:scroll"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
</head><body>

Out of all this info you only need:
<body onLoad="makesnake()" style="width:100%;overflow-x:hidden;overflow-y:scroll">

The rest can be deleted as it exists at the top of the document.

Basically your html document looks best and works best with the tags in this order above the body tag:

<html>
<head>
<title></title>
</meta>
</link>
<style></style>
<script></script>
</head>
<body>
...Then the rest of the document

It'll make sense if you look at another page (in IE click view on the toolbar and click source). You will see how they are formatted.

Once you have done this, if the problem is not fixed we can look further into it.

Thanks!

moonifa
07-06-2005, 12:01 PM
Thank you for a speedy reply! I apologize for not getting back to you sooner.

I went back into my index.html document after pasting your reply here in notepad. But what I saw didn't match. So I am going to copy and paste the code from my actual index.html.

If I can't figure out why the bottom scroll bar moves back and forth, and why the trailer script only works at the top of my page then I guess I will delete it. I am trying to learn HTML but my time is so very limited.

Anyway here is the actual code from as it shows on my index.html page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<html>
<head><style>
.spanstyle {
position:absolute;
visibility:visible;
top:-50px;
font-size:10pt;
font-family:Verdana;
font-weight:bold;
color:black;
}
</style>
<script>

/*
Cursor Trailor Text- By Peter Gehrig (http://www.24fun.ch/)
Permission given to Dynamicdrive.com to feature script in it's archive.
For full source code, installation instructions, and 1000's more DHTML scripts,
visit http://dynamicdrive.com
*/

var x,y
var step=20
var flag=0

// Your snappy message. Important: the space at the end of the sentence!!!
var message="Moonifa's Garden! "
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>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="Personal, Southern ,Ladys ,Thoughts,Christian" />
<meta name="description" content="Christian Family and Friends" />
<meta name="author" content="Rachel Henderson" />
<title> MoonifasGarden - A Bravenet.com Hosted Site </title>

<link rel="stylesheet" type="text/css" href="/style.css" />



</head>
<body onLoad="makesnake()" style="width:100%;overflow-x:hidden;overflow-y:scroll">



<div id="pageWrapper">

<div id="pageHeader">
<h1><P align=center>Moonifa's Garden</P> <P align=center>&nbsp;</P> <P align=center><IMG src="http://moonifasgarden.bravehost.com/myPictures/July004.gif"></TEXTAREA></FORM></P></h1>
</div>
<div id="subPageWrapper">

<div id="siteNavigation">
<h1>Navigation</h1>
<ul>
<li><a href="index.html" class="active">Main Page</a></li>
<li><a href="about.html" >Who Is Moonifa?</a></li>
<li><a href="links.html" >My Favorite Links</a></li>
<li><a href="history.html" >Today In History</a></li>
<li><a href="July.html" >Happy 4th Of July!!!!</a></li>
</ul>
<div id="listBreaker"> </div>
</div>



<div id="extraContent">
<div class="contentContainer">
<P>Warning! This site is made and maintained by a ...gasp! Hillbilly!!!!! A true Southern woman. I am richly blessed with a wonderful, loving husband Dillard who is my fiercest protector and loyal supporter. I continue to thank God for bringing us together. He is a real treasure! Between us we have six children, four of who are on their own and two still at home. Their ages range from 25 to 8 years old and we are also grandparents of four wonderful grandchildren. Our interests are many and varied and never a dull moment around here! Grab a cup of coffee, pull up a chair and visit a spell. <P> <P align=center> <P> <P>&nbsp;</P> </div>
</div>




<div id="userLinks">

<div class="linkSection">
<h1>Things To Do</h1>
<ul>
<li><a href="http://pub4.bravenet.com/horoscope/show.php?usernum=266633157">Horoscopes</a></li>
<li><a href="http://pub4.bravenet.com/cartoon/show.php?usernum=266633157">The Daily Cartoon</a></li>
<li><a href="http://pub4.bravenet.com/photocenter/album.php?usernum=266633157">My Photos</a></li>
<li><a href="http://Moonifa.bravejournal.com">View my Journal</a></li>
</ul>
</div>
</div>



<div id="extraContent2">
<div class="contentContainer">
<DIV align=center>&nbsp;</DIV> <DIV align=center><A href="http://pub4.bravenet.com/guestbook/266633157/"><IMG title="Free Guestbook from Bravenet.com" alt="Free Guestbook from Bravenet.com" src="http://assets.bravenet.com/cp/guestbook.gif" border=0></A>&nbsp;<A href="http://www.bravenet.com/"><IMG title="Free Guestbook from Bravenet.com" alt="Free Guestbook from Bravenet.com" src="http://assets.bravenet.com/cp/bn-guestbook.gif" border=0></A> </DIV> <DIV align=center>&nbsp;</DIV> <DIV align=center>Please take a minute and sign my Guestbook and let me know who you are. Feel free to leave your comments. </DIV><!-- End Bravenet.com Service Code --> </div>
</div>



<div id="mainContent">
<div class="contentContainer">
<P align=center>&nbsp;</SCRIPT> </P> <H2 align=center><FONT face="Comic Sans MS">&nbsp;&nbsp;Howdy! </SCRIPT>This is a work in progress. I envision a site that is interactive, wholesome, uplifting, and generously sowing the seeds of God's love. </FONT></H2><BR><BR> <H2 align=center>Please Enjoy Your Stay.</H2> <P>You will each&nbsp;be able&nbsp;to add something of yourself to this site. Isn't that what a garden is all about? A variety of colors and textures that creates the beauty. I just can't get into the concept that it's <EM>"all about me"</EM> because I don't believe that for one minute. It's all about each of us as individuals coming together to create, inspire, discuss and share ideas, sentiments, and hearts. As time goes on I hope there will be a lot of exciting content for you to explore. Ideas and&nbsp;suggestions are welcomed and appreciated! </P> <P align=center>Enjoy your time here and I hope you will continute to come back !&nbsp;&nbsp;&nbsp;&nbsp;</P> <P align=center></P> <P align=center><IMG style="WIDTH: 25px; HEIGHT: 25px" height=15 src="http://images.bravenet.com/common/images/smilies/redrose.gif" width=25></P> <P>If you need to look anything up while here please use the provided service posted here. I think you will like it!
</P> <P>&nbsp;</P> <P>&nbsp;</P> <DIV id=bigBox style="BORDER-RIGHT: #003399 1px solid; BORDER-TOP: #003399 1px solid; BORDER-LEFT: #003399 1px solid; WIDTH: 250px; BORDER-BOTTOM: #003399 1px solid; BACKGROUND-COLOR: #003399; TEXT-ALIGN: center"> <P style="MARGIN: 0px; WIDTH: 250px; BACKGROUND-COLOR: white"><A href="http://www.answers.com/" target=_blank><IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; VERTICAL-ALIGN: top; BORDER-LEFT: 0px; WIDTH: 105px; BORDER-BOTTOM: 0px; HEIGHT: 21px" src="http://www.answers.com/main/images/answers_small2.gif"></A><BR><SPAN style="FONT-SIZE: 13px; COLOR: #003399; FONT-FAMILY: Trebuchet MS">Concise information in one click</SPAN> </P> <FORM style="PADDING-RIGHT: 5px; DISPLAY: inline; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; WIDTH: 250px; PADDING-TOP: 5px" accept-charset=UTF-8 onsubmit="return document.getElementById('s').value != '';" action=http://www.answers.com/main/ntquery method=get><SPAN style="FONT-SIZE: 11px; COLOR: white; FONT-FAMILY: Trebuchet MS">Tell me about:</SPAN> <INPUT type=hidden value=5050 name=afid> <INPUT id=s style="WIDTH: 100px" maxLength=80 size=16 name=s> <INPUT type=submit value=" Go "> </FORM></DIV> <P>&nbsp;</P> <P>&nbsp;&nbsp;&nbsp; </P> </div>
</div>


<div id="subPageBreaker"></div>
</div>

<div id="pageFooter">
<h6><DIV align=center>&nbsp;</DIV> <DIV align=center><IMG src="http://moonifasgarden.bravehost.com/myPictures/america2.gif"></DIV> <DIV align=center>&nbsp;</DIV> <DIV align=center>&nbsp;</DIV> <DIV align=center>Copyright © 2005 Rachel Henderson. All Rights Reserved.</DIV> <DIV align=center><A href="mailto:moonifa2003@yahoo.com">moonifa2003@yahoo.com</A></DIV> <DIV align=center>&nbsp;</DIV> <DIV align=center>&nbsp;</DIV> <DIV align=center>&nbsp;</DIV> <DIV align=center>&nbsp;</DIV> <DIV align=center>&nbsp;</DIV> <P align=center></P><!-- Start Bravenet.com Service Code --> <SCRIPT language=JavaScript src="http://pub4.bravenet.com/counter/code.php?id=385688&amp;usernum=266633157&amp;cpv=2" type=text/javascript> </SCRIPT> <!-- END DO NOT MODIFY --></h6>
</div>
<div id="bntag">
This Website Built and Hosted for Free at <a href="http://www.bravenet.com">Bravenet.com</a>
</div>
</div><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;

// - End of JavaScript - -->
</script>


</body>
</html>


Hope you had a wonderful 4th of July! Thanks again. Moonifa (Rachel)

jscheuer1
07-06-2005, 12:42 PM
That stuff about your body tag may be beyond your control. Even with it looking messy like it does, this worked here. Try replacing your script with this one:


<script>

/*
Cursor Trailer Text- By Peter Gehrig (http://www.24fun.ch/)
Permission given to Dynamicdrive.com to feature script in it's archive.
For full source code, installation instructions, and 1000's more DHTML scripts,
visit http://dynamicdrive.com
Modified in Dynamic Drive Help Forums by jscheuer1 to work in NS6+ & FF1+
*/

var x,y
var step=20
var flag=0

// Your snappy message. Important: the space at the end of the sentence!!!
var message="Moonifa's Garden! "
message=message.split("")

function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}

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){
if ((document.getElementById)&&(!document.all)){
x = e.pageX
y = e.pageY
flag=1
}
else{
x = (document.layers) ? e.pageX : iecompattest().scrollLeft+event.clientX
y = (document.layers) ? e.pageY : iecompattest().scrollTop+event.clientY
flag=1
}
}

function makesnake() {
if ((flag==1 && document.all)||(flag==1 && document.getElementById)) {
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++) {
if ((document.getElementById)&&(!document.all)){
var thisspan = eval("document.getElementById('span"+(i)+"').style")
if (window.innerWidth){
if (xpos[i]>window.innerWidth-30)
thisspan.display='none'
else
thisspan.display='block'
}
thisspan.left=xpos[i]+'px'
thisspan.top=ypos[i]+'px'
}
else{
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>

moonifa
07-06-2005, 02:02 PM
Now that was a sppedy reply! LOL and thank you so much! I cut and pasted yoru version of the code and it helped a great deal! I can now see the script anywhere on the page. Now to go back and review the old version versus the new one to see what changes were made and if I can understand them LOL.

Ever learning,....onward and upward. :) Again my thanks to you and also to the first responder. I am impressed! Moonifa (Rachel)

moonifa
07-27-2005, 03:10 AM
I am so dissapointed. Your rewritten script worked beautifully. But I noticed a couple of weeks ago that it isn't there anymore.

WhenI go into my index file the script is still there. Any ideas? Thank you so much for your time!

Moonifa (Rachel)