Scrolling Text Displayed on a Page

I really need help on a solution for scrolling text displayed on a Notes page.

Subject: Scrolling Text Displayed on a Page

will effects of animated table give you anything near what you want?

Subject: Scrolling Text Displayed on a Page

It can be done easily enough with JavaScript and a couple of fields. The “marquee” should be an editable OS-style field wide enough to display a reasonably long line of text and tall enough to display at least three lines of text (four or more is probably better). The other field will be used as a source for the scrolling text, and can be hidden. (In this example, the “marquee” field is named “DisplayText” and the source field is named “TextSource”.)

The source field should be multi-value with a new line as a separator, and will probably be populated with a lookup or during the QueryOpen. The display field should be set to “Allow multiple lines”. Add this to the form’s JS Header (and make sure you select “Client”, not “Web”):

var sourceTextArray = new Array();

var displayTextArray = new Array();

var maxLines = 4;

function startScroll() {

sourceTextArray = document.forms[0].TextSource.value.split("\n");

for (var i = 0; i < maxLines; ++i) {

	displayTextArray.push(sourceTextArray.shift());

}

setInterval("displayScrollText()", 1000);

}

function displayScrollText() {

document.forms[0].DisplayText.value = displayTextArray.join("\n");

sourceTextArray.push(displayTextArray.shift());

displayTextArray.push(sourceTextArray.shift());

}

In the form’s onload event (again, make sure it’s the Client version), add:

startScroll()

That’s just a quick sketch of it. It’ll work, but it will blow up if there aren’t at least four lines to display in the source text, so you’ll want to add some error-checking stuff.

Subject: RE: Scrolling Text Displayed on a Page

This solution directs me to use a form. How can I use this for a notes page? My end result is an intranet home page made up of frames. This marquee would be displayed in one of the frames.

Subject: RE: Scrolling Text Displayed on a Page

You can use a Form wherever you’d use a Page – just add a SaveOptions field with a value of “0”. Having fields available is a Good Thing™ for a lot of purposes – like when you want to grab news from another location, f’rinstance. The animated table idea is also a good one, but it’s restricted to static text unless you use a Form instead of a Page.

Subject: RE: Scrolling Text Displayed on a Page

Ok, sounds good. However, I cannot get the DisplayText field to display the source text. When I use an alert to check the value of the DisplayText it is blank.

The following line is not writing anythig to the control:

document.forms[0].DisplayText.value = displayTextArray.join(“\n”);

Subject: RE: Scrolling Text Displayed on a Page

I have done some more testing and it does work but only after I double click on a field that puts the document in edit mode. How can I use the javascript to automaticallt put the document in edit mode?

Subject: RE: Scrolling Text Displayed on a Page

Sounds like you are opening a document – just open the Form as a Named Element in the frame. Forms (other than the specialised web $$XTemplate variety) always open in edit mode.