While on this topic...
 
I have been watching this thread with some interest since I have related issues.
 
I have worked with all three implementations as Richard illustrated in his e-mail. What I would like to know is this: If I create a button widget and use
 
      MenuButton.setHTML('<span class="buttonClass">This is a span inside a DynLayer with class="buttonClass"</span>')
 
in the onprecreate of the button, what  I would like to do with the onmouseover and onmousedown event handlers is to swap the css class, as in
 
MenuButton.listener.>    var o = e.getSource()
    o.class = "buttonClassOver"
}
 
This does not seem to work.
 
Is there a way to simply swap css classes on the fly?
 
Jim
 
 
 
----- Original Message -----
Sent: Wednesday, June 20, 2001 11:27 AM
Subject: Re: [Dynapi-Help] Converting an external stylesheet..

There are three things I know work, only the first is supported by NS4, and even then not if objects become nested to deep.
get a style sheet:
<STYLE TYPE="text/css">
<!--
.testClass {
 color: green;
 font-family: arial;
 font-size: 26;
 background-color: yellow;
 }
-->
</STYLE>
 
Then either: 1)
 
myLayer=new DynLayer(null,10,50,50,50,'green')
myLayer.setHTML('<span class="testClass">This is a span inside a DynLayer with class="testClass"</span>')
DynAPI.document.addChild(myLayer)
 
Or 2):
 
myLayer=new DynLayer(null,10,50,50,50,'green')
myLayer.setHTML('This is plain text inside a DynLayer with class="testClass"')
DynAPI.document.addChild(myLayer)
myLayer.className = "testClass"
//This ony works after a dynlayer as been added to the document.
 
Or 3):
 
myLayer=new DynLayer(null,10,50,50,50,'green')
myLayer.setHTML('This is plain text inside a DynLayer with the css altered.')
DynAPI.document.addChild(myLayer)
myLayer.css.padding="4px"  
myLayer.css.borderWidth="2px"
myLayer.css.borderColor="lightsalmon"
myLayer.css.borderStyle="solid"
 
As stated the last to don't seems to work in Ns4.(or not always)
 
Cheers,
Richard Bennett
 
[EMAIL PROTECTED]
www.richardinfo.com
(Everything running on, and ported to DynAPI2.53)
visit the DynAPI homepage (and FAQ) ::
http://dynapi.sourceforge.net/dynapi/index.php?menu=1
Browse (and search) the mailinglist here:
http://www.mail-archive.com/index.php3?hunt=dynapi
----- Original Message -----
Sent: 20 June, 2001 17:15
Subject: [Dynapi-Help] Converting an external stylesheet..

Can anyone please  tell me the syntax for converting an external stylesheet into a dynLayer. Is it something like: myDynLayer=new DynLayer("MyExternalCSS")  ??
Does the imported DynLayer contains the same properties as those set in the .css file??
 
Yours
Kasper

Reply via email to