W3C home > Mailing lists > Public > www-style@w3.org > October 2011

[CSS3 Animations] Pause an animation leaving an :hover state

From: Camille Bissuel <cbissuel@yagraph.org>
Date: Wed, 05 Oct 2011 07:42:17 +0000
Message-ID: <CA+zLOJy8brCiywOkuTKdSV-ag_sSoWJzFub7_0oGXH0fDG21sg@mail.gmail.com>
To: www-style@w3.org
Hi all,

I'm currently experimenting with CSS3 Animations, and try to achieve a
Panoramic view with CSS only (no javascript at all).

So far I obtain a sort-of-working demo :
The idea is simple : if the user hover the black rectangle in the borders,
the central background move.

source code :

But I fail to finish it, because when the mouse leave the :hover state, the
background is reset to its initial position.
I'm able to put a transition on the initial state to smooth that, but what I
wish to achieve is to pause the animation in its computed (or visual) state
when the mouse leave, or if you prefer, not to reset it to its initial

I'm writing to this list now, because after a full day of pocking around,
I'm not even able to conclude if this is really doable with CSS3

The animation-fill-mode: forwards; do not seems to work, neither triggering
the animation-play-state: paused on the initial state.
I suppose this is caused by the fact that I start the animation from another
DOM element than the animated one...

Can you help me, or assure me this is a vain attempt ?

Thanks a lot in advance,
Camille Bissuel
Received on Wednesday, 19 October 2011 10:12:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:06 UTC