[英]How do I use javascript to set the glyph-orientation-horizontal property on an svg text element?
How do I use javascript to set the glyph-orientation-horizontal property on an svg text element? 如何使用javascript在svg文本元素上设置glyph-orientation-horizontal属性?
I have tried 我努力了
svg.setAttribute("style","glyph-orientation-horizontal:90");
and also tried svg.style.glyph-orientation-horizontal=90;
并且还尝试了
svg.style.glyph-orientation-horizontal=90;
the first clears all style values so that style=''
the second throws a javascript error 第一个清除所有样式值,以便
style=''
,第二个清除javascript错误
svg is defined as var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
svg定义为
var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
Do I need to individually set the value on all child text elements of the container svg? 我是否需要对容器svg的所有子文本元素分别设置值? Or can I set the value on the container svg and the text elements will inherit that value?
还是可以在容器svg上设置值,文本元素将继承该值?
Any suggestions would be appreciated. 任何建议,将不胜感激。
Thanks, christopher 谢谢克里斯托弗
连字符变成骆驼
svg.style.glyphOrientationHorizontal = 90
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.