-1

我正在使用 D3 和 Raphael 两个库来创建图形。

现在,我怎么知道哪些代码来自 Raphael,哪些来自 D3?

假设我根据需要自定义了所有代码,有什么方法可以知道使用 javaScript。

4

1 回答 1

0

拉斐尔设置style="webkit-tap-highlight-color: rgba(0,0,0,0)"了它创建的所有元素,所以你可以...

function isRaphael(element) {
  if (!element || !element.getAttribute("style")) return null;
  return element.getAttribute("style").indexOf("webkit-tap-highlight-color") != -1;
}
于 2012-11-29T19:21:35.250 回答