0👍
The function executes immidately because you are calling it with ();
Just your code to this:
window.onscroll = this.fixNavBar;
Source:stackexchange.com
0👍
The function executes immidately because you are calling it with ();
Just your code to this:
window.onscroll = this.fixNavBar;