D
David Birnbaum
Dear comp.lang.javascript,
I'm attaching a mouseover event handler to a <p> element that consists of just a few words. When I mouse over the element, the event fires, but it also fires when I mouse over the blank space to the right, after the end of the textual content. This latter behavior is distracting to my users, who don't expect mouse movements in that area to interact with the <p> because as far it looks to them, the <p> ends where the visible text ends.
I'm guessing that this happens because the width of my <p> is being reported as 100% of the width of the containing <body> element. Is there a way to change this behavior, so that the event will fire only when the user mousesover the visible text within the <p>? I tried attaching the event to the text node within the <p>, and that generates no errors when loading (Firefox4 on Windows 7), but it also doesn't work--the mouseover event generates no errors, but it simply doesn't fire.
Thanks,
David ([email protected])
I'm attaching a mouseover event handler to a <p> element that consists of just a few words. When I mouse over the element, the event fires, but it also fires when I mouse over the blank space to the right, after the end of the textual content. This latter behavior is distracting to my users, who don't expect mouse movements in that area to interact with the <p> because as far it looks to them, the <p> ends where the visible text ends.
I'm guessing that this happens because the width of my <p> is being reported as 100% of the width of the containing <body> element. Is there a way to change this behavior, so that the event will fire only when the user mousesover the visible text within the <p>? I tried attaching the event to the text node within the <p>, and that generates no errors when loading (Firefox4 on Windows 7), but it also doesn't work--the mouseover event generates no errors, but it simply doesn't fire.
Thanks,
David ([email protected])