From: Guangyi Wu <gua...@al...> - 2000-11-22 13:27:14
|
I used the dynapi.gui.label.html in package posted by Dan. There is a table in the layer, and a font in the td. I was surprised to see the e.srcElement pointing to FONT tag in the debugger by onmousedown event. AFAIK, src should refer the layer most near bottom to start DYNAPI event bubbling. In IE, the "this" in EventMethod() should be this phisical layer, because it is registered in captureMouseEvents(). If it is, this.lyrobj should be a better start layer than tis.lyrobj.dyndoc. Are there other exceptions I ignored? br George > -----Original Message----- > From: Pascal Bestebroer [mailto:pb...@oi...] > Sent: Wednesday, November 22, 2000 12:42 PM > To: dyn...@li... > Subject: RE: [Dynapi-Help] Event Problems - dyndoc.id > > > the e.srcElement will point to the layer or an image, as far > as I know other > html elements don't trigger onmousexx events. > > The problem with images is being solved in the creation of > the layers by > adding the lyrobj property to every image in a layer (done with normal > dynlayers and inline layers) > > I just tested (on an older version of the API) with putting > text in a layer > (dynlayer and inline) and the events mouseout and mouseover triggered > correctly without errors. > > > Question for Eric, what was the error you got? (not the > location, but the > message) > > Pascal Bestebroer > pb...@oi... > http://www.oibv.com > > > -----Oorspronkelijk bericht----- > Van: dyn...@li... > [mailto:dyn...@li...]Namens Guangyi Wu > Verzonden: woensdag 22 november 2000 10:54 > Aan: 'dyn...@li...' > Onderwerp: RE: [Dynapi-Help] Event Problems - dyndoc.id > > > I am afraid the new version has the same problem. Consider > the following > code in the DynLayer.EventMethod > > ===== > var realsrc=is.ie ? e.srcElement:e.target > var which=(is.ie||is.ns5)?e.button:e.which > var src=realsrc.lyrobj||dyndoc > if (!src) return true > ===== > > if there is html code in the most underlying layer, the > e.srcElement points > to an element in that layer. Hence, realsrc.lyrobj is > undefined and src is > assigned to dyndoc, and the original layer and the layer > between it and > dyndoc cannot get the event. > > I change the line > var src=realsrc.lyrobj||dyndoc > to > var src=realsrc.lyrobj||this.lyrobj > > and it works for me in an example file (the label from Dan) > to catch the > event. But I am not sure if this modification is correct. > > Another often mentioned workaround is to add a cover layer to > catch the > events. I come into this problem when I test the Dan's new > label, which > removes the cover layer. > > br > George > > > -----Original Message----- > > From: Pascal Bestebroer [mailto:pb...@oi...] > > Sent: Wednesday, November 22, 2000 9:36 AM > > To: dyn...@li... > > Subject: RE: [Dynapi-Help] Event Problems - dyndoc.id > > > > > > EventMethod is called on any mouse event on the > corresponding layer or > > document. > > Try upgrading to the latest version, it might fix some > > problems with this.. > > > > I think the problem might be in your code somewhere.. events > > should work > > normally on inline layers. > > > > Pascal Bestebroer > > pb...@oi... > > http://www.oibv.com > > > > > > -----Oorspronkelijk bericht----- > > Van: dyn...@li... > > [mailto:dyn...@li...]Namens Eric Gravel > > Verzonden: woensdag 22 november 2000 8:36 > > Aan: dyn...@li... > > Onderwerp: [Dynapi-Help] Event Problems - dyndoc.id > > > > > > I'm getting errors in IE 5.0 The first occurence is when I move my > > mouse over an inline layer. The second instance is when I click an > > image map that is inside a 2 level deep child layer (child layer of > > a parent child layer). > > > > When debugging the code using MS Development Environment, it points > > the error as belonging to file core.api.events.js: > > > > src=DynAPI.getDocument(realsrc.dyndoc.id) > > > > The line belongs to the following code block: > > > > var realsrc=is.ie ? e.srcElement:e.target > > var which=(is.ie||is.ns5)?e.button:e.which > > var src=realsrc.lyrobj > > if (!src) { > > src=DynAPI.getDocument(realsrc.dyndoc.id) > > if (!src) return true > > } > > > > So e.srcElement.lyrobj does not exists. Why? The other question > > I have is when does this function, DynLayer.prototype.EventMethod, > > gets called? > > > > If needed, I can provide the whole code. > > > > > > Eric > > ______________________________________________________________ > > ______________ > > _________ > > Get more from the Web. FREE MSN Explorer download : > http://explorer.msn.com > > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > |