The following line would run the function inside it when the width is above 770px and below 1024px - the question is, how can I include the width of the scrollbar to it?
if (width < 1024 && width > 770) {}
I already tried implementing window.pageXOffset
or window.innerWidth with no hope!