From 106d8cc8fff82083b8d77754dcdfb3153d4bd00e Mon Sep 17 00:00:00 2001 From: cssmagic Date: Wed, 9 May 2018 11:40:46 +0800 Subject: [PATCH] Add notes. --- doc/index.md | 2 +- notes/chapter-3/306.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 notes/chapter-3/306.md diff --git a/doc/index.md b/doc/index.md index 4c70721..0881270 100644 --- a/doc/index.md +++ b/doc/index.md @@ -37,7 +37,7 @@ issue: 17 303| [11] 菱形图片|-|〃|- 304| [12] 切角效果|[试读](https://github.com/cssmagic/CSS-Secrets/issues/11)|〃| [免费阅读](https://github.com/cssmagic/CSS-Secrets/issues/38) 305| [13] 梯形标签页|-|〃|- -306| [14] 简单的饼图|-|〃|- +306| [14] 简单的饼图|-|〃| [免费阅读](https://github.com/cssmagic/CSS-Secrets/issues/85) | | **第四章** | **视觉效果**|| [购买后阅读 ](http://www.ituring.com.cn/book/tupubarticle/9396)| 401| [15] 单侧投影|-|〃|- diff --git a/notes/chapter-3/306.md b/notes/chapter-3/306.md new file mode 100644 index 0000000..4c3a508 --- /dev/null +++ b/notes/chapter-3/306.md @@ -0,0 +1,18 @@ +--- +title: "[注解] [306] 简单的饼图" +issue: "#85" +--- + +## 交流与答疑 + +微信用户 **天下第二** 提问: + +> 我发现单个标签画饼图有一个问题,就是 100% 的状态没法显示。 +> +> [这篇博客](https://www.cnblogs.com/joyjoe/p/6922917.html) 用了书上的代码,如果把最下面那个图改成 `animation-delay:-100s`,本来希望是整个饼图显示 `#655` 颜色,但是实际上恢复了初始状态的绿色。 + +临时回复如下: + +我暂时没有去深入分析原因。在不改变动画代码的前提下,最简单的变通解决办法是把 `-100s` 写成 `-99.999s`。 + +如果你是用脚本来写入元素的 `.style.animationDelay` 的话,在写入之前减去 `0.001` 即可;或者判断一下,当发现写入值为 `100` 时,改为 `99.999` 再写入。