I am working on an html5 interface that uses drag and drop. While I drag the element, the target gets the css class, which makes it bidirectional rotation due to -webkit animation.
@-webkit-keyframes pulse { 0% { -webkit-transform: rotate(0deg); } 25% { -webkit-transform:rotate(-10deg); } 75% { -webkit-transform: rotate(10deg); } 100% { -webkit-transform: rotate(0deg); } } .drag { -webkit-animation-name: pulse; -webkit-animation-duration: 1s; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: ease-in-out; }
When I drop the target, I want it to take the current state of rotation.
My first thought was to test the css property with jquery and the .css method ('- webkit-transform'). But this method simply returns "none".
So my question is: is there a way to get the current degree value of an element that rotates through the animation?
Thanks. Hendrick
html5 css3 animation drag-and-drop transform
larrydahooster
source share