Update of /cvsroot/dynapi/dynapi/examples
In directory usw-pr-cvs1:/tmp/cvs-serv29638
Added Files:
dynapi.api.bubbling.html
Log Message:
New example file allows to test proper event bubbling
--- NEW FILE ---
<html>
<head>
<title>DynAPI example - event bubbling</title>
<script src='../src/dynapi.js'></script>
<script>
DynAPI.setLibraryPath('../src/lib')
DynAPI.include('dynapi.api.browser.js')
DynAPI.include('dynapi.api.dynlayer.js')
DynAPI.include('dynapi.api.dyndocument.js')
DynAPI.include('dynapi.api.events.js')
function debug(t) {
document.forms[0].f.value+=t+"\n"
}
DynAPI.onLoad = function() {
a = new DynLayer(null,50,50,300,300)
a.setBgColor('red')
b = new DynLayer(null,-10,-10,100,100)
b.setBgColor('blue')
b.setZIndex(20)
c = new DynLayer(null,10,10,50,50)
c.setBgColor('green')
d = new DynLayer(null,50,-10,100,100)
d.setBgColor('orange')
d.setZIndex(10)
l = new EventListener()
l.onmouseover = function(e) {
debug('over '+e.getSource())
}
l.onmouseout = function(e) {
debug('out '+e.getSource())
}
l.onclick = function(e) {
debug('click '+e.getSource())
}
l.ondblclick = function(e) {
debug('click '+e.getSource())
}
a.addChild(b)
a.addChild(d)
b.addChild(c)
a.addEventListener(l)
b.addEventListener(l)
c.addEventListener(l)
d.addEventListener(l)
a.setHTML("<table><tr><td width=250 height=100
bgcolor='yellow'>a</td></tr><tr><td width=350 height=100
bgcolor='yellow'></td></tr></table>")
this.document.addChild(a)
}
</script>
</head>
<body bgcolor='black'>
<br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>
<form>
<textarea rows=5 cols=60 name=f></textarea>
</form>
</html>
_______________________________________________
Dynapi-CVS mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-cvs