附加图像我使用此代码
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)
但无济于事..
如何将字符串与jquery text()进行比较?我试过这个,但是不行.
var str = 'hello';
var string = $(this).find("text").trim();
if(str == string)
{
string.css("visibility", "visible");
}
Run Code Online (Sandbox Code Playgroud)
我的代码出了什么问题?有什么好主意吗?谢谢