12
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

Solution

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


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

var scrollTopValue = element.scrollTop;  

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.

Solution

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


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

var scrollTopValue = element.scrollTop;  

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.