The focus method is used to give the focus to (ie make current) the object that it belongs to. Giving a text field the focus will move the cursor to that field. Giving a window the focus will move it in front of all of the others.
But if I understand correctly you aren't trying to change the current object, you're trying to stop the window from scrolling.
This is just a guess, without seeing the page at all: The "like" button is an <a> element with its
As I said, just a guess. Can you link to the page in question? If not, can you create/upload/link to an example that demonstrates the problem? If not, can you at least post the markup & code you're using? Then we could track down the bug for sure and provide a definite answer.