This demo is completely JavaScript-free. Feel free to move the character around with the D-pad, and notice how it always keeps its position after you stop moving.
This is made possible by using a virtually infinite transition delay, so that the CSS rules never return to their default state. The character will always be stuck in a transition and only moves when you hold down a button.
I've written a blog post explanining how this all works, but please keep in mind that things like this should ideally be handled with Javascript. After all, this is a dirty hack, not a CSS feature.
Maintaining css Style States Using "Infinite" Transition Delays