I don't think you can. It might be possible to write enough custom Javascript to enable something like that functionality, but it would depend on the reader to support it.
This level of interactivity is going to require an app or a more sophisticated platform. A web page with (probably extensive) Java or Javascript is probably a minimum.