Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

determining if a text field will need to scroll

Status
Not open for further replies.

iostream71

Programmer
Mar 13, 2002
229
US
i have a text field that is displaying imported text. i also have 2 arrows, above and below, that i want to show if there is text to scroll up or down to

it works fine except for the initial display, because i don't know if if it's going to scroll or not until it does, then the arrows show up
 
this will work but the code could be improved

lines = 10; //number if lines of text the box will take
scroll._visible = false;//set the arrows to invisible
mydata = new loadvars;
mydata.onload = function (){
mytext.htmltext = mydata.text;
mydata.load("rubbish.txt");
max = mytext.maxscroll - lines;
if (max>0){scroll._visible=true;//make them visible if needed.
}
}
mydata.load("rubbish.txt");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top