Click to See Complete Forum and Search --> : java script
kevin10
07-11-2003, 10:30 PM
hi guys. I wrote this java script, a text scroller. Everything seems to work fine, but i cant change speed. Can someone please take a look and tell me what is wrong? Thanks for any input.
<marquee><span style="font: 33px; color:red;"><br><br><br><br><br><b>Welcome Kevin</b></span></marquee>
<body>
<Script>
ScrollSpeed = 1000
ScrollChars = 1
function ScrollMarquee() {
window.setTimeout('ScrollMarquee()',ScrollSpeed);
var msg = document.marquee;
document.marquee=
msg.substring(ScrollChars)+
msg.substring(0,ScrollChars);
}
ScrollMarquee()
</Script>
</body>
brendandonhue
07-11-2003, 11:05 PM
Where is your ScrollMarquee() function?
kevin10
07-12-2003, 12:13 AM
I am new to this , so i don't know what your saying. If you paste the code and try it, it works without any "function". I don't know what i am missing.
fla5hba5h
07-12-2003, 03:30 AM
Originally posted by brendandonhue
Where is your ScrollMarquee() function?
It's under where he defined his variables.
document.marquee=
msg.substring(ScrollChars)+
msg.substring(0,ScrollChars);
Put that into one line.
stancreator
07-12-2003, 06:18 AM
if you ask me i think you should use the HTML version of a marquee. It's so much easier;
take a look at some of the ones on my site:
http://www.surfinstan.com
and tell me if you'd like to know how to do it. All it needs is a simple <marquee> and </marquee> tag. With extra option obviously, including speed.
kevin10
07-12-2003, 12:15 PM
Hi Stancreator! Thanks for replying. I hope you don't mind me stealing your code from your website. I am just trying to learn a new hobby, that's all. Your code is quite simple and works great. I looked at the code at a tutorial website, doing the same thing (as your code does) and it took up a whole page. That is why there are "good" and "not good" teachers.
:). Thanks
stancreator
07-12-2003, 12:58 PM
don't mention it. i don't mind you using some of my code, did you find out about the different speeds?
P.S. what's your websites URL?
kevin10
07-12-2003, 01:07 PM
I used your method to change speed inside <marquee> and it worked. Like i said, i modified the code from a tutorial website from one page down to few lines, so i think it got broken somewhere in the code. The original code ran the text in a box (<form></form>) and used the function i left in the code to change the speed of the text. I wanted to get rid of the box so i changed <form> to <marquee>, so i guess the original speed function does not apply for marquee tag.
stancreator
07-12-2003, 01:51 PM
I see, what is your websites address?
kevin10
07-12-2003, 03:10 PM
Here is my website address, it's for educational purpose so i don't put anything fancy on it. I used Frontpage software to create it, when i didn't have much knowledge about html.
http://pages.drexel.edu/j~alt34/default
kevin10
07-12-2003, 03:11 PM
Sorry!
http://pages.drexel.edu/~alt34/default
kevin10
07-12-2003, 03:13 PM
http://www.pages.drexel.edu/~alt34/default.htm