I am new to DynAPI, but am experienced in JavaScript. I'm wondering if
this is a bug, or just a consequence of the differing event models
between NS4x and IE5x. The issue:
If I use setHTML to set the HTML that includes tags (e.g. <H4>) of a
DynLayer, it only responds to the events in NS4x.
It the argument to setHTML includes only text, it works well on NS4x,
IE5x, and NS6.

I edited dynapi.api.mouseevents.htm (included in the 11/07/200
distribution) to illustrate the behavior. The text of my file is below,
as well as attached to this e-mail.

&lt;!--
Modified: 2000.11.05
--&gt;
&lt;html&gt;

&lt;head&gt;
&lt;title&gt;DynAPI Distribution: MouseEvents Example&lt;/title&gt;

&lt;script language="Javascript"
src="../js/dynapi.js"&gt;&lt;/script&gt;

&lt;script language="Javascript"&gt;

DynAPI.setLibraryPath('../js/lib/')

DynAPI.include('dynapi.api.*')

DynAPI.onLoad=function() {
 frontMenuLyr = new DynLayer("front");
 frontMenuLyr.setSize(150,68);
 frontMenuLyr.setBgColor('#c0c0c0');
 // setHTML with no embedded tags works as expected
// frontMenuLyr.setHTML("Front View");
 // events not fired in IE 5, IE 5.5, Win32
 frontMenuLyr.setHTML("&lt;h4&gt;Front View&lt;/h4&gt;");
 frontMenuLyr.moveTo(50,50);
 myListener = new EventListener(DynAPI.document)
 // tried this, did not make any difference
// myListener = new EventListener(frontMenuLyr)
 myListener.onmouseover=function(e) {
  frontMenuLyr.setBgColor('#ffc000')
  window.status = 'Last Event: onmouseover'
 }
 myListener.onmouseout=function(e) {
  frontMenuLyr.setBgColor('#c0c0c0')
  window.status = 'Last Event: onmouseout'
 }
 myListener.onmousedown=function(e) {
  frontMenuLyr.setBgColor('#0000c0')
  window.status = 'Last Event: onmousedown'
 }
 myListener.onmouseup=function(e) {
  frontMenuLyr.setBgColor('#ffc000')
  window.status = 'Last Event: onmouseup'
 }
 myListener.onrtmouseup=function(e) {
  frontMenuLyr.setBgColor('#ffcc00')
  window.status = 'Last Event: onrtmouseup'
 }
 myListener.onrtmousedown=function(e) {
  frontMenuLyr.setBgColor('#00cc00')
  window.status = 'Last Event: onrtmousedown'
 }
 myListener.onmdmousedown=function(e) {
  frontMenuLyr.setBgColor('#11cc00')
  window.status = 'Last Event: onmdmousedown'
 }
 myListener.onmdmouseup=function(e) {
  frontMenuLyr.setBgColor('#ffcc00')
  window.status = 'Last Event: onmdmouseup'
 }
 myListener.ondblclick=function(e) {
  window.status = 'Last Event: ondblclick'
  alert('double-click')
 }
 DynAPI.document.addChild(frontMenuLyr)
 frontMenuLyr.addEventListener(myListener)
}

&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;

Any clarification would be appreciated.
Title: DynAPI Distribution: MouseEvents Example

Reply via email to