【问题标题】:How to use percent on Raphael js Paper.path?如何在 Raphael js Paper.path 上使用百分比?
【发布时间】:2019-06-24 07:56:43
【问题描述】:

使用 Rephael js,我们可以执行以下操作:

paper.circle('20%', '20%', 30);

我的问题是:我该怎么做(注意使用 %):

paper.path('M 20% 20% L 100 150');

【问题讨论】:

    标签: svg raphael


    【解决方案1】:

    这就是我所做的:

    var twentyPercent = $('#paper_div').width() * 20/100;//20%
    var paper = Raphael(document.getElementById("paper_div"), paperWidth, paperHeigth);
    paper.path("M" + twentyPercent + " " + twentyPercent + "L 100 150");
    

    我必须手动计算百分比。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-19
      • 1970-01-01
      • 2015-03-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多