小编Lyn*_*arl的帖子

如何在d3.js中制作图像

附加图像我使用此代码

       node.append("image")
            .attr("xlink:href", function(d) { return d.img; })
            .attr("x", -25)
            .attr("y", -25)
            .attr("width", 50)
            .attr("height", 50)
Run Code Online (Sandbox Code Playgroud)

我希望图像是圆的,我试图使用此代码

   .attr("style", "border-radius: 30px;");
Run Code Online (Sandbox Code Playgroud)

但它没有用..我也试过这个

<style>
   .node image{
      border-color: 2px solid orange;
       border-radius: 25px;
    }

</style>
Run Code Online (Sandbox Code Playgroud)

但无济于事..

javascript image append d3.js

4
推荐指数
1
解决办法
4534
查看次数

jquery text()与string比较

如何将字符串与jquery text()进行比较?我试过这个,但是不行.

var str = 'hello';
var string = $(this).find("text").trim();

if(str == string)
{          
   string.css("visibility", "visible");
}
Run Code Online (Sandbox Code Playgroud)

我的代码出了什么问题?有什么好主意吗?谢谢

javascript jquery

2
推荐指数
1
解决办法
4万
查看次数

标签 统计

javascript ×2

append ×1

d3.js ×1

image ×1

jquery ×1