Is there any way to program an ASP page to automatically detect scrolling? I.E. If if sees scrolling due to text which is too long for the screen, it'll toss up a message box warning that you'll have to scroll down?
That's a calculation you have to do yourself.
I don't think there's an easy and direct way to determine that. The code shouldn't be difficult.
First determine the height/width of the screen, then the height/width of the text. After that, use something like this:
If TEXT.Height/Width > SCREEN.Height/Width Then
..somecode..
else
..yetmorecode/ornocode..
End If
This helps out immensely, thank you! One more thing though, can you tell me how I can figure out the height of the text? I'm using an include here:
<!-- #include file="filler.asp"-->
Ok so I'm trying the text file route, but I keep getting an error message saying:
Microsoft VBScript runtime error '800a01a8'
Object required: 'This is just filler '
/BOP/test.asp, line 41
Now here's the code I'm running:
<%
Dim fso, f
Dim text
Set fso = CreateObject("Scripting.FileSystemObject"
Set f = fspenTextFile("c:\inetpub\
1)
text = f.ReadAll
If text.Height > Screen.Height Then
Msgbox "This text is too long, cut it!"
Else
Msgbox "This text is ok for this page."
End If
%>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.