Skip to content

Instantly share code, notes, and snippets.

@eduardolundgren
Created October 25, 2011 18:52
Show Gist options
  • Select an option

  • Save eduardolundgren/1313831 to your computer and use it in GitHub Desktop.

Select an option

Save eduardolundgren/1313831 to your computer and use it in GitHub Desktop.
Graphics API issue
<html>
<head>
<title></title>
</head>
<body>
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
<div style="position: absolute; background-color: #ff0000; top: 200px; left: 200px; width: 60px; height: 60px;" id="test"></div>
<script type="text/javascript">
YUI().use('graphics', function(Y) {
var g = new Y.Graphic({render: '#test', autoSize:true});
var s = g.addShape({
height: 41,
type: 'rect',
stroke: {
weight: 7,
color: '#000'
},
width: 41
});
s.translate(10, 10);
s.rotate(45);
// s.end();
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment