I have a set of radio buttons inside a div which has a fixed height and overflow:hidden. Some of the radios get hidden because they would be naturally positioned outside the height of the containing div.
When a radio is selected, and that radio is outside the visible part of the div, the div gets scrolled.
What I want is to be able to lock the scrolling of the div, regardless the currently checked radio is visible or not. I don't want the div to scroll.
Instructions to reproduce:
In FF/IE:
- Click on a radio button
- Use up/down arrows
Here is the code: http://www.jsfiddle.net/kANKu/1/
<div style="width:200px; height:100px; border: solid 1px red; margin:0 auto;overflow:hidden;">
<input type="radio" name="rad1" value="hello" id="hello1" /><label for="hello1">hello1</label> <br />
<input type="radio" name="rad1" value="hello" id="hello2" /><label for="hello2">hello2</label> <br />
<input type="radio" name="rad1" value="hello" id="hello3" /><label for="hello3">hello3</label> <br />
<input type="radio" name="rad1" value="hello" id="hello4" /><label for="hello4">hello4</label> <br />
<input type="radio" name="rad1" value="hello" id="hello5" /><label for="hello5">hello5</label> <br />
<input type="radio" name="rad1" value="hello" id="hello6" /><label for="hello6">hello6</label> <br />
<input type="radio" name="rad1" value="hello" id="hello7" /><label for="hello7">hello7</label> <br />
<input type="radio" name="rad1" value="hello" id="hello8" /><label for="hello8">hello8</label> <br />
<input type="radio" name="rad1" value="hello" id="hello9" /><label for="hello9">hello9</label> <br />
</div>