views:

161

answers:

1

See this page: http://ryan.rawswift.com/sandbox/fixed-bottom-bar/

When you load this page, and try hitting space bar, page up/down or use the scroll wheel on your mouse, it doesnt scroll at all. This is because the page is wrapped inside a secondary "viewport" in order to place the facebook bar in the bottom of the page.

When you click anywhere on the page, you give the div focus, and the keys/mousewheel works fine.

Is there any way to set this focus trough JavaScript or jQuery in order to make the keys/mousewheel work?

Cheers, Ole Marius

+1  A: 

This should do the trick:

$("#myDiv")[0].focus();
karim79
Nope, this didnt work. It gives focus to the div, but seems like something else is needed before the spacebar and other button will work except clicking inside the viewport..
olemarius