wac
11-02-2006, 05:30 PM
I've written my own list object using a DIV with overflow:auto and a table containing the list items. On up/down arrow I move the highlight focus through the list items. Since the scrollbar automagically captures up/down arrow and does its own thing, I've done event.returnValue = false so the scroll bar doesn't get the event and my stuff works well. This is fine in IE, but in firefox I can't get the same to occur. I've tried all the incantations I know for cross browser event cancellation using the function below to no avail. I cannot get firefox to behave the same as IE. Firefox DIV scroll bars
still capture up/down arrow and scroll the DIV.
function stopEventPropagation(e)
{
if (undefined == e) e = window.event;
e.cancelBubble = true;
e.returnValue = false ;
if (undefined != e.stopPropagation) e.stopPropagation();
}
What my code does is to scroll the DIV only if the highlight focus is moved outside the visible part of the DIV, the way a real list works.
still capture up/down arrow and scroll the DIV.
function stopEventPropagation(e)
{
if (undefined == e) e = window.event;
e.cancelBubble = true;
e.returnValue = false ;
if (undefined != e.stopPropagation) e.stopPropagation();
}
What my code does is to scroll the DIV only if the highlight focus is moved outside the visible part of the DIV, the way a real list works.