Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (36 sloc) 895 Bytes
<!doctype html>
<html>
<head>
<script src="../donatello.js" type="text/javascript"></script>
<script src="../line.js" type="text/javascript"></script>
<script>
var line;
/**
* Kitchen sink drawing method for smoke test.
*/
function main() {
var paper = Donatello.paper('paper-div', 20, 20, 300, 300 );
// example of a nested set of objects using declarative json
// initialization
line = paper.line( 20, 20, 50, 50, {
stroke:'red',
'stroke-width':5
});
line.dom.onclick = function() { console.log( 'clicked on the line' ) };
}
function resize( evt ) {
console.log( evt.clientX );
line.attr( { 'stroke-width': evt.clientX } );
}
</script>
<style>
#paper-div {
border: 1px solid black
}
</style>
</head>
<body onload='main();' onclick='resize(event);' onmousemove='resize(event);'>
<div id="paper-div">
</div>
</body>
</html>
Something went wrong with that request. Please try again.