Hello,
Im new to DYNAPI2 development, and i have a stupid problem:
In the code below, i
- create a main layer (navBarLyr)
- add a child to it (foo)
- add some html to the child WITH a style: text-align:center
- add the main layer to dynapi.document
BUT
- When i set the width of the child, after i added the main layer to
dynapi.document, the HTML is centerd vis-a-vis the main layer, not vis a vis
foo!!!
--> this does not happen when i set the (foo) size BEFORE adding to
dyanapi.docuemnt/
MY QUESTION:
-- is it me, or the DYNAPI
thnx,
pieter.
<html>
<head>
<Script language="Javascript" src="../src/dynapi.js"></script>
<Script language="Javascript">
DynAPI.setLibraryPath('../src/lib/')
DynAPI.include('dynapi.api.*');
DynAPI.onLoad=function()
{
navBarLyr=new DynLayer()
navBarLyr.moveTo(5,5)
navBarLyr.setBgColor('#ccff00')
navBarLyr.setSize(300, 300)
foo=new DynLayer()
navBarLyr.addChild(foo)
foo.setBgColor('#ccffcc')
foo.setHTML('<div style="text-align:center;">test</div>')
// - Add main container to the document
DynAPI.document.addChild(navBarLyr)
foo.setWidth(200)
}
</script>
</head>
<body><!--form><select><option>ds</select></form--></body>
</html>
|