Hi. I am new to this mailing list and hope I am using it right.
Confirmation to let me know will be appreciated.
I have an issue regarding nested tables and mouseover().
<table>
<tr>
<td class="class1"> //Let's say this is a book record, which
contains title, author, publisher, etc.
<table>
<tr>
<td = "class2"> // Let's say this is the book's
table of contents
The second <table> is a dynamic append to the innerhtml of the first <td>
The desired effect is to let user mouseover contents in the second <td> and
do "something special," like navigate the book via each link in the table of
contents.
The problem is that going into the 2nd table, a user (unknowingly) is also
going into the 1st table <td>.
".class1" is fired when that is not the intent. "class2" should be fired.
I was referred to quirksmode to research further into this issue.
http://www.quirksmode.org/js/events_mouse.html
In the section toward the middle, which deals with mouseover, it is
demonstrated that a person can determine "from where" the event originated
at its deepest level of nesting.
See the example used on that page that has layered divs and a span:
http://www.quirksmode.org/js/eventexample.html This is described a little
in the discussion which links to it.
So, if we start from the outside-most element (say <body>) and we are moving
the mouse to target the table of contents, we will necessarily cause a fire
on the main book record ("class1"). Apparently, the article states that you
can suppress a fire by knowing where the event came from (the
relatedTarget's fromElement).
By flow of logic, we will always have to first come from <body> to go into
the "table of contents" ("class2"), and by necessity, the "from where" will
be at <body> upon entering from outside and moving in. So, therefore, in
trying to get to the 2nd <td> "table of contents", it seems we will
invariably fire on the 1st <td> "book record", even though we don't want to.
My question is this: If the dimensions of the bounded area of the displayed
text of the "table of contents" are the same size as the "title," except
that, for one side (the top), the title of the book stoicks out from behind,
will using the relatedTarget's fromElement suppress unwanted firing of the
1st <td>, provided you don't come into the table of contents from the top
(over the title)?
Next question: If anyone is a jquery pro, how would you program the
onmouseover() to basically say:
$(1st class).ifNotIn2ndClass.onmouseover()..
To make the 1st class fire only if you are not in the 2nd class?
Thanks. (I hope I am using this mail list correctly).
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/