javascript - Why would this code not work y = window.scrollY;? -
i attempting utilize next code:
y = window.scrolly;
for reason, on particular website, y = 0 regardless of how far scroll vertically. there particular reason this? work on other websites. problem not limited browsers (tested on chrome , firefox).
update: found out reason issue site contained within div position set relative. there way around without disrupting content of site?
i couldn't sure bet using div container scrolls , not "window".
y = document.getelementbyid("container").scrolly;
javascript web scroll
No comments:
Post a Comment