with (simulated) media queries I'm changing font-size of <select>
s in my page
I have problems with other browsers too, but I resolved temporarily detaching the elements from DOM and re-attaching them after a small amount of time
but with MSIE8 I still have problems with height of <option>
s which is equal to the max fontSize set, even if it's not applied anymore
http://fiddle.jshell.net/U3bzT/show/light/
expected result:
the font-size
is updated while switching from a bigger font size to a smaller one
but not the line-height/height of <option>
s
happens to both select-multiple and select-one
how can I fix this?
Note: <select>
s may have events attached, so I can't use a copy
<script>
// just some code to simulate media query on/off state
var select;
setTimeout(function(){
select = document.getElementsByTagName("select")[0];
select.style.fontSize='40px';
webkitFix();
setTimeout(function(){
select.style.fontSize='10px';
webkitFix();
},5000);
},5000);
function webkitFix(){
document.body.removeChild(select);
setTimeout(function(){ document.body.appendChild(select); }, 1);
}
</script>
<select multiple size="6" style="font-size:10px">
<option>AAAAAA1</option>
<option>BBBBBB2</option>
<option>AAAAAA3</option>
<option>BBBBBB4</option>
<option>AAAAAA5</option>
<option>BBBBBB6</option>
<option>AAAAAA7</option>
<option>BBBBBB8</option>
<option>AAAAAA9</option>
</select>
select
etc…) – Destruct