Question
1
Replies
39
Views
Deloitte
Posted: June 11, 2019
Last activity: June 11, 2019
Closed
Enabling a control(CheckBox or Button etc) on complete scroll of a screen
Hello All,
We are trying show an uploaded to document to the user. As part of it once user reviews the complete document i.e. on scrolling down completely, we want to enable the control.
Please help me with any ideas..
Thanks in advance.
***Edited by Moderator: Lochan to update platform capability tags***
Hi,
This can be achieved by using custom javascript. We can enable the button based on the position of the scroll bar. Please try the script below:
document.getElementsByName("licenseAgreement")[0].addEventListener("scroll", checkScrollHeight,false);
function checkScrollHeight(){
var textElement = document.getElementsByName("licenseAgreement")[0]
if((textElement.scrollTop + textElement.offsetHeight)>= textElement.scrollHeight){
document.getElementsByName("button")[0].disabled =false;
}
}