Learn Create Your Own Split Screen

Next Page

Depending on your browser and screen size, you may have noticed that in addition to the cat responding to your up and down keys, the browser window is scrolling at the same time.

This is because the browser also gets told about the key event.

Fortunately there's an easy way to tell the browser "don't worry, I've got this event handled". Just include this line in your handler:

function MyKeyDownHandler (MyEvent) { : : MyEvent.preventDefault(); }