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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrolling detection? 1

Status
Not open for further replies.

jisoo22

Programmer
Apr 30, 2001
277
US
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?

Thanks,
Jisoo22
 
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

Hope I could help.
 
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=&quot;filler.asp&quot;-->


Or is it easier to use a text file?

Thanks,
Jisoo22
 
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(&quot;Scripting.FileSystemObject&quot;)
Set f = fso_OpenTextFile(&quot;c:\inetpub\ 1)
text = f.ReadAll
If text.Height > Screen.Height Then
Msgbox &quot;This text is too long, cut it!&quot;
Else
Msgbox &quot;This text is ok for this page.&quot;
End If
%>


Can someone tell me what I'm doing wrong?

Thanks,
Jisoo22
 
Looks like the problem is in your include file. It is trying to find an object or method called 'This is just filler '

I cant see that line in your code sample, so assume it is in the inc. file. Steve Davis
hey.you@hahaha.com.au
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top