View Full Version : Require Viewer to Scroll Down
DestinieBTC
11-15-2006, 12:25 PM
Is there a way that I can require people to scroll an entire paragraph, like a disclaimer, in order to click on a button to accept and move on?
TJ_Tigger
11-15-2006, 12:55 PM
Initially I would say that you would have to use the On Timer event and compare the Paragraph.GetScrollPos with the max value from Paragraph.GetScrollRange. If they match then you know they have scrolled to the bottom of the page and you can then enable the button.
Tigg
Roboblue
11-15-2006, 01:47 PM
As Tigger said.
First, you have to find the Max range of the scroll bar in the paragraph with all the text loaded and displayed in the para. Ah, but here's the rub. The up/down arrows in the scroll bar is counted in the total range, so you have to subtract the size of the arrow from the .Max range value. I have found that the size of the scroll arrow is 22.
Then you have to compare the Max-22 to Scroll the present Scroll position
Then, if the scroll bar is at the max position, enable the button.
Try this (replace my object names with your object names)
Page - On Show
Page.StartTimer(1000)
Page - On Timer
---this will get a table with the Scroll RAnge. Use .Min or
---.Max to get values
tScroll = Paragraph.GetScrollRange("EULA_para", true);
---this will get the present scroll position
nScroll = Paragraph.GetScrollPos("EULA_para", true);
---compare position to Max range - 22 pixels
if nScroll == tScroll.Max - 22 then
---if it meets the above do
Button.SetEnabled("I Agree_btn", true);
end
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.