![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
But there are greater problems. Once you mouseover the td and put an image in there, as soon as the cursor goes over the image it is "out" of the td, so the onmouseout fires and replaces the image with the text again. I've tried to stop propagation but have failed, perhaps someone else here has a suggestion. rather than inserting and removing an image element, it might be better |
#2
| |||
| |||
|
|
RobG wrote: But there are greater problems. Once you mouseover the td and put an image in there, as soon as the cursor goes over the image it is "out" of the td, so the onmouseout fires and replaces the image with the text again. I've tried to stop propagation but have failed, perhaps someone else here has a suggestion. rather than inserting and removing an image element, it might be better to use css, eg: x.style.backgroundImage = "url(' + cellImgArray[x.id] + '")'; and: x.style.backgroundImage = ""; Nick |
#3
| |||
| |||
|
|
Regardless, until a solution is proposed for the flicker problem caused by the mouseover/out, it's not going to be useful. I think Richard has a good idea - have the mouseover change an adjoining cell. That was the main reason I suggested using the style property, the |
#4
| |||
| |||
|
|
RobG wrote: Regardless, until a solution is proposed for the flicker problem caused by the mouseover/out, it's not going to be useful. I think Richard has a good idea - have the mouseover change an adjoining cell. That was the main reason I suggested using the style property, the status of the pointer hasn't changed, there's no new element to alter things thus the flicker is avoided. |
#5
| |||
| |||
|
|
Interestingly, in IE both cells behave completely reliably - if mouseover fires, then mouseout is guaranteed (at least as far as my testing can determine). Is this a bug with Firefox mouseover/out events? |
#6
| |||
| |||
|
|
An artifact of mouseover/out in Firefox is that the events don't always fire - rapid mouse movement can prevent them from happening - however the CSS method does not display this. Below is a test page that has two cells: the left one just toggles the display of an image or text, the right hides the text and uses CSS background image to display the image. Both avoid flicker. In the left cell, rapid mouse movement can cause the mouseout event not to fire. The far right cell keeps a log of the last 10 events, the element that fired them and the cell the event is registered to so it is easy to see a mouseover on the left cell immediately followed by a mouseover on the right. The missing mouseout means the image is still displayed in the left cell. It also neatly shows the bubbling of events - sometimes the mouseover is called by an image or span and not the td. Internally, mouseout/over is being called constantly in the left cell (it happens in the right cell too if something is displayed). Interestingly, in IE both cells behave completely reliably - if mouseover fires, then mouseout is guaranteed (at least as far as my testing can determine). Is this a bug with Firefox mouseover/out events? The only way I could reproduce the mouseout error in Mozilla (I don't |
#7
| |||
| |||
|
|
RobG wrote: [...] Interestingly, in IE both cells behave completely reliably - if mouseover fires, then mouseout is guaranteed (at least as far as my testing can determine). Is this a bug with Firefox mouseover/out events? The only way I could reproduce the mouseout error in Mozilla (I don't have FF installed atm) was by using rapid movement to move the pointer out of the browser window, the mouseout won't fire until the pointer is bought back into the cell and out again. |
|
After doing some more testing in mozilla, it seems that if either 'mouseover IMG' or 'mouseover SPAN' appears then the mouseout has failed (ie I only see these appear on failure) for left and right cells respectively (the right cell only fails infrequently, but then I can't consistantly trip the left cell either). |
![]() |
| Thread Tools | |
| Display Modes | |
| |