CSS3 "animate-play-state:;"

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
User avatar
Pazuzu156
Forum Contributor
Posts: 241
Joined: Sat Nov 20, 2010 9:00 pm
Location: GA, USA
Contact:

CSS3 "animate-play-state:;"

Post by Pazuzu156 »

I'm working with CSS3 messing with Animations, etc. I'm using JavScript to enable play/pause, the syntax is

Code: Select all

object.style.animatePlayState="play|paused";
I want to be able to use a javascript function that can toggle this when they click the object, how would I go about doing this?
- Kaleb Klein
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
User avatar
getmizanur
Forum Commoner
Posts: 71
Joined: Sun Sep 06, 2009 12:28 pm

Re: CSS3 "animate-play-state:;"

Post by getmizanur »

use javascript framework such jquery and prototype
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: CSS3 "animate-play-state:;"

Post by Eran »

That values are actually "running|paused". The function would look something like:

Code: Select all

function toggleAnimation(el) {
    el.style.animatePlayState = el.style.animatePlayState == 'paused' ? 'running' : 'paused';
}
Keep in mind that this property might be removed from the spec soon, see notes on https://developer.mozilla.org/en/CSS/an ... play-state
financrisval
Forum Newbie
Posts: 1
Joined: Thu Jul 07, 2011 11:12 am

Re: CSS3 "animate-play-state:;"

Post by financrisval »

This forum is very informative regarding coding. Maybe I can learn a lot here.:D
Post Reply