From: Peter B. <bar...@ho...> - 2000-11-18 18:32:17
|
Nope, the thing is that I don't know the size of the text and that is actually the reason for using DynAPI in the first place (Netscape you know =]). However, that it's not wokring flawlessly in IE for Mac doesn't even come close to it not working in NS 6. Though fiddling with the order that you set the properties solves most of the problems. The big problem however, always seem to stem from getWidth() and getHeight() in both Netscape 6 (PC) and IE 4.5+ (Mac). They always seem to return zero... Anyone know or have a link to a page with info about the status for DynAPI in Netscape 6? Regards, Peter Bartholdsson > I have run into a similar problem, I found that if I specify all of the > attributes of the DynLayer when instantiated that it works fine on Mac IE > 4.5 and 5. Don't even try IE 4. The DHTML Support of Mac IE 4 is > practically non-existant. So you would have to use the full constructor. > > pblayer0 = new DynLayer(10, 10, 300, 200, '#f0f0f0'); > > > This would create the layer without errors but I see that you are trying the > same thing I was. Setting the content then GETTING the height. I found > that this could not be done on the Mac without the error you are referring > to. I hope that pointing out that everything works fine if you specify > everything on the Mac will help the developers find the problem. > > M. > > -----Original Message----- > From: dyn...@li... > [mailto:dyn...@li...]On Behalf Of Peter > Bartholdsson > Sent: Friday, November 17, 2000 8:33 AM > To: dyn...@li... > Subject: [Dynapi-Help] getHeight() not working in ns 6 > > Hi all, > > This little piece of code works fine on everything but > IE4+ on Mac and Netscape 6... getWidth() and getHeight() > seems to be the problem in both cases. > As I'm quite new to the DynAPI I'm very interested in any > comments on my way of using it that may cause this problem. > > This code even works in Netscape 4.05, the browser of horror =) > > Regards, > Peter Bartholdsson > > > <html> > <head> > <title>Untitled</title> > </head> > > <script language="Javascript" src="/js/dynapi.js"></script> > <script language="Javascript"> > DynAPI.setLibraryPath('/js/lib/'); > DynAPI.include('dynapi.api.dynlayer'); > DynAPI.include('dynapi.api.browser'); > DynAPI.include('dynapi.api.dyndocument'); > DynAPI.onLoad=function() { > // browser = new Browser(); > pblayer0 = new DynLayer(); > pblayer0.setBgColor('#f0f0f0'); > pblayer0.moveTo(10, 10); > pblayer0.setWidth('300'); > this.document.addChild(pblayer0); > pblayer0.setHTML('hej hej<br>Bluttan blä på er alla!'); > pblayer0.setHeight(pblayer0.getContentHeight()); > pblayer1 = new DynLayer(); > pblayer1.setBgColor('#c0c0c0'); > pblayer1.setHTML('hej hej<br>Bluttan blä på er alla!'); > pblayer1.moveTo(pblayer0.getX() + 0, pblayer0.getY () + > pblayer0.getHeight() > + 10); > pblayer1.setWidth(pblayer0.getWidth() + 0); > this.document.addChild(pblayer1); > pblayer2 = new DynLayer(); > pblayer2.setBgColor('#a0a0a0'); > pblayer2.setHTML('hej hej<br>Bluttan blä på er alla!'); > pblayer2.moveTo(pblayer0.getX() + pblayer0.getWidth() + 10, > pblayer0.getY() > + 0); > pblayer2.setWidth('300'); > pblayer2.setHeight(pblayer1.getHeight() + pblayer1.getHeight() + > 10); > this.document.addChild(pblayer2); > pblayer3 = new DynLayer(); > pblayer3.setBgColor('#808080'); > pblayer3.setHTML('hej hej<br>Bluttan blä på er alla!'); > pblayer3.moveTo(pblayer1.getX() + 0, pblayer1.getY () + > pblayer1.getHeight() > + 10); > pblayer3.setWidth(pblayer1.getWidth() + pblayer2.getWidth() + 10); > this.document.addChild(pblayer3); > > } > </script> > </head> > > <body> > > </body> > </html> |