Skip to content

Instantly share code, notes, and snippets.

@magmoro
Created February 23, 2009 14:00
Show Gist options
  • Save magmoro/68956 to your computer and use it in GitHub Desktop.
Save magmoro/68956 to your computer and use it in GitHub Desktop.
var SVG={
ns: 'http://www.w3.org/2000/svg'
}
var svg = document.createElementNS(SVG.ns, 'svg').inject(document.body);
svg.setAttribute('width',100);
svg.setAttribute('height',100);
svg.setStyles({
position: 'absolute',
left:10,
top:10
});
var text=document.createElementNS(SVG.ns, 'text');
text.setAttribute('font-size',20);
text.setAttribute('font-family','Arial');
text.style.position='absolute';
text.setAttribute('x',10);
text.setAttribute('y',20);
text.setAttribute('transform', "rotate(90) translate(0 -40)");
//text.setAttribute('transform', "translate(30 0)");
var textNode=svg.ownerDocument.createTextNode('MooTools');
text.appendChild(textNode);
svg.appendChild(text);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment