Forum Moderators: open
when over an iframe you can scroll its content by using a scroll-wheel mouse. Try this with a textarea and you find you first have to give focus to that element before the scroll-wheel-mouse can be used. With a <div style="overflow: auto; height: 200px;"> Apparently in Firefox no scroll-wheel-mouse can be used at all on scrollable div's. It only allows scrolling by using the arrow on scrollbar or scrollbar-arrows.
Regrettably I have to say IE is fine with this, Firefox is not.
If so, all older versions still have this bug, is there a workaround for this?
I have experimenten with javascript to give focus to the <div> on mouseover, works for textareas, but not for div's in firefox.
There is however a bit of Javascript that'll (sort of) fix this for 1.0 users. This is courtesy of Morten Nilsen who came up with this workaround on the original bug discussion:
<html>
<head>
<title>Mozilla bug #9728 workaround v.2</title>
<style type="text/css">
div {
width: 200px;
height: 100px;
overflow: auto;
border: solid 1px black;
}
</style>
<script type="text/javascript">
function fixScroll(div) {
var s = div.scrollTop;
div.childNodes[1].focus();
div.scrollTop = s;
}
</script>
</head>
<body> <div onmouseover="fixScroll(this);">
<a></a>
Long text Long text Long text Long text Long text Long text Long text Long text
Long text Long text Long text Long text Long text Long text Long text Long text
Long text Long text Long text Long text Long text Long text Long text Long text
Long text Long text Long text Long text Long text Long text Long text Long text
Long text Long text Long text Long text Long text Long text Long text Long text
Long text Long text Long text Long text Long text Long text Long text Long text
</div>
</body>
</html>
Your bug may well remain a problem for some users for longer than you would think.