Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get @keyframe current value in css3 with javascript

See the demo here: http://jsfiddle.net/hamidrezabstn/fgcPa/5/

When I click on the middle raindrop , I would like it to rotate to the current position of the spinning circle! I tried below the JS code but it doesn't work! The next thing I want to do is the raindrop rotate with spining circle!

 $(function() {
    $('#center').click(function() {
        var pos = $('#circle').css('transform')
        $(this).css('transform', 'pos')

        });
});
like image 341
hamidrezabstn Avatar asked Dec 25 '22 21:12

hamidrezabstn


1 Answers

  $(function() {
    $('#center').click(function() {
        var obj, matrix;
        obj = document.getElementById('circle');
        matrix = getComputedStyle(obj).getPropertyValue('transform');
        console.log(matrix);
        //$(this).css('transform', matrix)

        });
});   

read more here http://dev.opera.com/articles/view/understanding-3d-transforms/

like image 52
Gildas.Tambo Avatar answered Dec 28 '22 12:12

Gildas.Tambo