28
Views
3
Comments
Solved
Outsystems UI window.scrolly value won't change

Hi,

am working on  changing the header color when  the user scrolls but the window.scrollY value is always zero, can anyone tell me why the value won't change

2023-02-09 12-36-42
Damian Fonville
Solution

I also asked a colleague what the native javascript version is. 


var element = document.querySelector(".screen-container"); 

var scrollTopValue = element.scrollTop;  

2023-02-09 12-36-42
Damian Fonville

I don't know what the exact issue is with OutSystems.


But you can use some jQuery to solve this problem.


$(".screen-container").scrollTop this will return the current scroll position.

2023-02-09 12-36-42
Damian Fonville
Solution

I also asked a colleague what the native javascript version is. 


var element = document.querySelector(".screen-container"); 

var scrollTopValue = element.scrollTop;  

2023-02-09 12-36-42
Damian Fonville

You can use Jquery the same ways as Javascript, This worked for me.



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.