innerHTML javascript events not firing

Discussion in 'Javascript' started by teb, Sep 22, 2004.

  1. teb

    teb Guest

    Hello all,

    Here is basically the situation. I have an empty div on my page.
    When I mouseover a word, the innerHTML of the div gets written with a
    table. The td elements all have onclick, onmouseover, etc. events.
    When I mouseover a word, the div appears, but none of the events fire
    until another event occurs. For example, if I put in an alert box or
    I right click, and then mouseover the div, the td events then work.
    Keep in mind that the div is basically acting as a menu. So the
    sequence of events that I'm seeing are as follows: mouse over a word,
    div appears but none of the events are firing, right click to bring up
    std context menu, left click to close, mouseover div again and events
    fire.

    Here is how I'm setting the innerHTML of the div (I know it could be
    cleaner, I'm just testing something).

    oContextMenu.innerHTML ='<table width="100" border="0" cellpadding="0"
    cellspacing="1" bgcolor="#000000"><tr ><td bgcolor="#cdaf95"
    onMouseOut="this.style.background=\'#F7F7F7\';hideMenu();"
    onClick="setValue();hideMenu();" onMouseOver="this.style.background
    =\'#E8E8E8\';this.style.cursor = \'hand\';">blah</td></tr></table>';

    Any help would be appreciated.

    teb
     
    teb, Sep 22, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    0
    Views:
    311
  2. =?Utf-8?B?U2hvdXJpZQ==?=
    Replies:
    1
    Views:
    7,947
    =?Utf-8?B?U2hvdXJpZQ==?=
    Jan 21, 2004
  3. SevDer
    Replies:
    2
    Views:
    1,312
    Walter Wang [MSFT]
    Nov 13, 2007
  4. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    388
    Chris
    Aug 30, 2005
  5. sonic
    Replies:
    5
    Views:
    296
    Randy Webb
    Jul 11, 2006
Loading...

Share This Page