Fix javascript navbar scroll event

We need to asign the correct variable to make the actual effect work