开发者

JQuery SVG and font coloring

开发者 https://www.devze.com 2023-04-07 00:37 出处:网络
How do I change the color of text using JQuery SVG? I currently have the following code: <html> <!-- jquery imports here -->

How do I change the color of text using JQuery SVG?

I currently have the following code:

<html>
<!-- jquery imports here -->
<script type="text/javascript" charset="utf-8">
    $(function() {
            $('#myContainer').svg({});        
            var svg = $('#myContainer').svg('get');                
            svg.tex开发者_运维技巧t(200, 200, "SomeText", {'font-family':"Verdana", 'font-size':20, 'text-anchor':"middle"});
        });

    window.onload = function () {
        // more code
    }
</script>
<body>
    <div id="myContainer" style="width: 640px; height: 480px;"></div>
</body>
</html>


Try to change fill. {'text-anchor':"middle", 'fill':"#00ff00"}

0

精彩评论

暂无评论...
验证码 换一张
取 消