【发布时间】:2015-06-18 05:24:14
【问题描述】:
缩短,我正在使用(使用)复制将代码添加到 DOM 的正方形(路径),但是只有 1px(调试镶边)。对第六块用户是不可见的! 谢谢你! code in: codepen
$(function() {
$('#svg').css('visibility', 'visible');
$('#svg use').css('fill', '#fff');
function addAnim() {
var $first = $('#svg use:not(.anim):first');
$first.attr('class', 'anim').css('fill', '#F15A29');
$first.animate({fill : '#F15A29'}, 500);
setTimeout(function() {
addAnim();
}, 100);
}
function replicar(){
var svg = document.getElementById('svg');
var elemento= document.createElementNS('ttp://www.w3.org/2000/svg', 'use');
elemento.setAttribute('xlink:href', '#shape');
elemento.setAttribute('y', '62');
elemento.setAttribute('x', '124');
elemento.setAttribute('fill', '#3D6EB5');
svg.appendChild(elemento);
addAnim();
replicar();
});
【问题讨论】:
标签: javascript animation svg