svg clippath动画在webkit中无法正常工作

时间:2014-09-22 07:02:07

标签: svg webkit jquery-animate tunnel

https://github.com/shaadh/tunnel-gallery

这是我添加的javascript动画片段路径中svg圈标记的半径

function tunnel_gallery()
{    
    timerFunction = setInterval(tunnelanimate, 20);
}
function tunnelanimate()
{
    var clip = document.getElementById("circle1");
    var rad = clip.getAttribute("r");
    var tunnel_width = jQuery("#tunnel-mask").parent().width();
    var newrad = 2 + parseInt(rad);    
    if (newrad > tunnel_width)
    {
        clearInterval(timerFunction);
        clip.setAttribute("r", 0);
        timerFunction = null;
    }
    else
    {       
        clip.setAttribute("r", newrad);
    }
}

0 个答案:

没有答案