I need to create a drop down that is not as wide as its contents. I have the below script so far which does just that - but only in IE. Might I be lucky enough to get a little help to get this same function to work in Netscape, please?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Artificial Drop Down menu</title>
<script>
function myClick(mySelect,fake,real){
t1=document.getElementById(fake);
t2=document.getElementById(real);
t1.options[0].text=mySelect.options[mySelect.selectedIndex].text;
t1.options[0].value=mySelect.options[mySelect.selectedIndex].value;
t2.style.visibility='hidden';
}
function myBlur(real){
t=document.getElementById(real);t.style.visibility='hidden';
}
</script>
</head>
<body>
<div id="real_1" style="position:relative; top:20px; visibility: hidden;"><div id="dummy" style="position:absolute;">
<select size="20" onClick="myClick(this,'fake_1','real_1')" onBlur="myBlur('real_1')">
<option>1
<option>2
<option>3
<option>4
<option>5555555555555555555555555555555555555555555555555555
<option>6
<option>7
<option>8
<option>9
<option>10
</select>
</div></div>
<select id="fake_1" onFocus="t=document.getElementById('real_1'); t.style.visibility='visible';body.focus();return false;">
<option>20
<option>20
</select>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Artificial Drop Down menu</title>
<script>
function myClick(mySelect,fake,real){
t1=document.getElementById(fake);
t2=document.getElementById(real);
t1.options[0].text=mySelect.options[mySelect.selectedIndex].text;
t1.options[0].value=mySelect.options[mySelect.selectedIndex].value;
t2.style.visibility='hidden';
}
function myBlur(real){
t=document.getElementById(real);t.style.visibility='hidden';
}
</script>
</head>
<body>
<div id="real_1" style="position:relative; top:20px; visibility: hidden;"><div id="dummy" style="position:absolute;">
<select size="20" onClick="myClick(this,'fake_1','real_1')" onBlur="myBlur('real_1')">
<option>1
<option>2
<option>3
<option>4
<option>5555555555555555555555555555555555555555555555555555
<option>6
<option>7
<option>8
<option>9
<option>10
</select>
</div></div>
<select id="fake_1" onFocus="t=document.getElementById('real_1'); t.style.visibility='visible';body.focus();return false;">
<option>20
<option>20
</select>
</body>
</html>