With onclick and ondblclick registered to a div/table, I can rarely get ondblclick to fire!
Apr 6th, 2008 18:43
ha mo, Colin Fraser, neko noguchi,
Firstly, registering both events to fire on the same handler is always
going to be risky. the vagaries of the operating system, the different
speeds at which people click and double click will always cause some
problems. This is so obvious however, that I suspect that this is not
the question you are asking.
The question you are asking, I think, may be "why can I not get events
to properly fire inside the table that lies in a div." You have
constructed the div properly, the table too, but it still causes
problems, and is it the table that is causing the problem? Happens all
that just does not work properly. I have no clear idea why, ever noticce
how technical manuals and books tend not to say a lot about tables?
Anyway, this is not being overly helpful, but the answer appears to be
somewhat simple, create your table dynamically.
document.write("table width='50%' name="mytable">
document.write("<tr><td>Data</td><td>1st image rollover</td><td><a
document.write("<tr><td>Data</td><td>2nd image rollover</td><td><img
whatever code you want, place inside the script in the appropriate
places, dont ask me why though, I know this works. More scripts work
inside tables that are dynamically created then those that are not. Just
make sure of your double and single quote marks.