I don't think you need the <div id="target"> tag. Try
rewritting your code to reflect the following:

var lyrmaster  = dynapi.document.addChild(new
DynLayer('<img
src="./insertion_embed.png">',50,150,null,null,'silver'));
// Note: w & h can only be null or integer values 

var lyr1 = lyrmaster.addChild(new DynLayer('I 
want this layer to respond to clicking, and pop up
lyr3', 50, 50, 200, 100, 'red'));

// setup event listener
var el = {
   onclick : function(e){
      lyr2.set.Visible(true);
   }
};
// add event listener to layer
lyr1.addEventListener(el);

var lyr2 = ...
var lyr3 = ...


--
Raymond Irving

--- Yanglong Zhu <[EMAIL PROTECTED]> wrote:
> Hi everyone,
> 
> I'm new here.
> I just started trying DynAPI out. I have had some
> successes. But I have 
> lots of questions as well. So far, I can combine my
> own code with 
> DynLayer to generate interactive editing features in
> Mozilla , however 
> IE is very stubbon to be reigned in. My question is:
> How do you add 
> eventListener() to a element generated in
> DynLayer()?
> 
> var lyrmaster  = dynapi.document.addChild(new
> DynLayer('<img 
>
src="./insertion_embed.png">',50,150,'auto','auto','silver'));
> var lyr1 = lyrmaster.addChild(new DynLayer('<div
> id="target" 
> onmouseover="lyr2.set.Visible(true);return false;">I
> want this div to 
> respond to clicking, and pop up lyr3</div> ', 50,
> 50, 200, 100, 'red'));
> var lyr2 = ...
> var lyr3 = ...
> 
> The key part I am trying to get working is how to
> add an eventListener 
> to the element id="target", and pops up lyr3.  I use
> my own code can 
> make it work in Mozilla. However it does not work in
> IE. Besides I 
> believe DynAPI must have a nicer way to do this in
> IE and Mozilla than 
> what I have come up with.
> 
> Thanks.
> 
> Yanglong
> 
> 
> 
> 
>
-------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/dynapi-help


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to