| A bit more complicated, but don't forget that you only have to copy and paste the code here on to your page. You don't have to actually program or write anything yourself.
Scrolling scripts can do their thing all over your browser, scrolling in the status bar, across the top of the screen or even appearing one letter at a time. This one is probably the least annoying!
This script is slightly different, and we found it at the Javascript Source, an excellent archive of scripts you can use any time. It is written in two parts; the first section needs to be copied into the "HEAD" section of your HTML, and the second within the "BODY" (you remember, so that it is in the bit of the page that gets published in the browser window itself). Don't worry about what it all means, if it works and you are interested, then you can learn more about Javascript by looking through the Netscape Javascript Manual, or getting the latest great Javascript book from us in the "Further reading" section.
Section 1 inbetween the <HEAD> tags:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var display_text = "Put what you want to see "
+ " in between these quote marks "
+ " and you will find that it appears on the page instead of this text! "
var display_text;
var place;
var meter;
var out = " ";
var place = 50;
function scroll_text() {
for (meter = 0; meter < place; meter++) {
out += " "}
if (place >= 0)
out += display_text
else out = display_text.substring(-place,display_text.length)
document.scroll_form.field.value = out
out = " "
place--
if (place < -(display_text.length)) {
place = 50
}
setTimeout('scroll_text()',100)
}
// End -->
</SCRIPT>
Section 2 inbetween the <BODY> tags:
<CENTER>
<FORM NAME="scroll_form">
<input type="button" name="button_one" value="Start" onClick="scroll_text()">
<input type="text" name="field" size="50">
</FORM>
</CENTER>
<!-- Script Size: 1.30 KB -->
Don't forget to tell your readers to click on the button to see the latest news from your site, and good luck with learning more Javascript.
|