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"}
精彩评论