-
Notifications
You must be signed in to change notification settings - Fork 1
/
code.xhtml
40 lines (34 loc) · 1.18 KB
/
code.xhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version='1.0'?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg">
<head>
<title>firelight</title>
<script type="text/javascript" src="jquery-1.2.6.js" />
<script type="text/javascript" src="firelight-debug.js" />
<script type="text/javascript">
<![CDATA[
$(document).ready(function() {
var root = new Canvas ({ Width: 800,
Height: 500 });
var brush = new LinearGradientBrush ();
brush.gradientStops.addItem (new GradientStop ({ Color: "red",
Offset: "0%" }));
brush.gradientStops.addItem (new GradientStop ({ Color: "blue",
Offset: "100%" }));
root.background = brush;
root.addEventListener ("MouseLeftButtonDown", function(sender, args) { alert ("button down!"); });
var host = new SvgHost ({ domElement: document.getElementById("svg-host"), // jquery doesn't seem to work here);
rootVisual: root });
});
]]>
</script>
</head>
<body>
<svg:svg id="svg-host"
width="1024"
height="768"
version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink">
</svg:svg>
</body>
</html>