I’m trying to create a user navigation system that displays a certain amount of text at a time, hides the rest and recalls more text via user input ( a la back and forward buttons.)
For example, say this is the text:
Blah Blah Blah, Blah Blah
Yadda Yadda Yadda Yadda
“Yadda Yadda Yadda Yadda” is hidden so you would only see the “Blah”s. The user could only see the “Yadda”s if they press the forward button. To return to the “Blah”s they would hit the back button.
I’m having trouble getting the display to work correctly, I’m know I’m doing something wrong.
[CODE]var text=300 //(or any number);
function Display() {
if (!document.getElementById) return;
obj=document.getElementById(“thetext”);
for (i=0, obj.innerText.length < text, i++)
if (obj.innerText.length < text)
obj.style.display.block;
return;
if (obj.innerText.length < text)
obj.style.display.none;
obj + “…”;
}
I haven’t figured out how to assign the back and foward mechanisms yet.