I read the article Dropdownlist width in IE but unfortunately I couldn’t adapt it to my needs.
I have a select list with some of the options opening URLs in a new window and I use the below jQuery:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
The script for linking the options of the select list is the following:
<script type="text/javascript">
$(document).ready(function() {
$('.openSelect').change(function(){
var selectedValue=$(this).val();
if (selectedValue.match(/http/)) {
var open = window.open($(this).val(),'_blank');
if (open == null || typeof(open)=='undefined'){
alert("Please turn off pop-up blocker and reload this page to visit: " + selectedValue);
}
}
});
});
</script>
My problem is that the drop-down menu width is restricted by the table cell’s width in IE6, 7 and 8 so I must somehow fix it to expand to the width of the longest option content. The only restriction is that I have to keep the above script and somehow modify it, not change it altogether.
An example of the select list is given in the following page: http://www.myairlease.com/available/available_for_lease_737