I'd say that your browser application is 'losing focus'. Only one application can accept mouse/keyboard input at any time, this is the program that is currently 'in focus', and one way of giving a window focus is by clicking into it but poorly written applications can 'steal' focus. It is common that the 'in focus' window has a different colour title bar - you can test this by having a few applications on the screen (not full screen but a bit smaller) then clicking into them.
So I'd say your problem is that your 'scroll' command is going to another application and when you click back into the browser application you gain control of the browser window.
As for what program it is that's gaining focus and why it's happening, unfortunately this is not trivial to troubleshoot.
Some decent suggestions on the link below if you are confident in applying them - the suggestions will apply to all versions of Windows, not just 7.
https://superuser.com/questions/301183/how-to-detect-a-background-program-in-windows-7-which-steals-active-focus-auto