A JS implementation of CSS :active, for more control