This is a known problem in NS.
Noone is quite sure under what circumstances this
will occur, but there is a work-around:
When you write your text to the layer, wrap it in a table that is the size
of the layer.
You don't need to set a height (You may see the same problem if you do)
But placing your text in a table that is the same width as the layer will
cause it
to look normal..

:-)

Example:
Note: to make the text look as it should I use
border=0 cellspacing=0 cellpadding=0
on the table

var myLayer = DynAPI.document.addChild(new
DynLayer('myLayer',10,10,100,150));
myLayer.setHTML('<table border=0 cellspacing=0 cellpadding=0 width='
                            + myLayer.getWidth() +'><td><tr>'
                            + "Some text"
                            + '</td></tr></table>');

If you don't want to write out the table tag each tim, you can use a
function:
function wrapInTable(iWidth,strContent){
    return '<table border=0 cellspacing=0 cellpadding=0 width='
              + iWidth +'><td><tr>'
              + strContent
              + '</td></tr></table>';
};
var myLayer = DynAPI.document.addChild(new
DynLayer('myLayer',10,10,100,150));
myLayer.setHTML(wrapInTable(myLayer.getWidth(),'some text'));




----- Original Message -----
From: "Stefan Keller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 25, 2002 9:31 AM
Subject: [Dynapi-Help] NS 4.x - strange behaviour


> Hi,
>
> im using DynApi 2.5.7 to develop some DHTML-Online-Games.
>
> When i set HTML to some DynLayers NS 4.x makes a break
> after each word!!! This is very strange.
>
> An Example:
>
> ablauf[marke][2] = "Hallo this is text";
> dlyr1.setHTML("<font face='"+tffaceSP+"' color='"+tlcolorSP+"'
> size='"+tsizeSP+"'><b>"+ablauf[marke][2]+"</b></font>");
>
> This will be displayed as:
>
> Hello
> this
> is
> text
>
>
> also see: http://www.pepperhouse.de/projekte/machs/411/index.html
> 2 clicks -> the blue text on the right site
> the first tree words should be in one line!!!
>
> Please could anyone help.
> NS 4.x makes a lot of trouble while using DynApi(i got some more
Problems).
>
>
>
> greetings
> Stefan
>
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dynapi-help
>


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to