最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - d3 opacity transitions flash final state - Stack Overflow

programmeradmin1浏览0评论

I have a number of basic opacity transitions along the lines of

emp_line.transition()
    .duration(1250)
    .attr('opacity', 1)

However, when I run them, often these items will flash to full opacity and then back to none and fade in. Is there any way to prevent this content flickering?

I have a number of basic opacity transitions along the lines of

emp_line.transition()
    .duration(1250)
    .attr('opacity', 1)

However, when I run them, often these items will flash to full opacity and then back to none and fade in. Is there any way to prevent this content flickering?

Share Improve this question edited Sep 12, 2012 at 12:36 paxRoman 2,0623 gold badges19 silver badges32 bronze badges asked Sep 6, 2012 at 21:15 futuraprimefuturaprime 5,5687 gold badges42 silver badges60 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 17

Testing this, it looks like you get the flicker with .attr('opacity'), but not with .style('opacity'), so changing the transition to .style() should fix this.

Test fiddle: http://jsfiddle.net/nrabinowitz/Y5uX6/

No idea why this should be true though :(.

发布评论

评论列表(0)

  1. 暂无评论