I'm developing a website in asp.net, and I use the msDropdown-master jQuery to modify an turn a dropdownlist "more beautiful", placing images in the options and so on.
But using this control, I have a real problem because it doesn't work fine in IE9 and lowers...
From Firefox the control appear like this:
From IE 9, seen in IETester appear like this:
This is how the control should appear in all browsers, I pretend to made my site crossbrowing for all versions of IE7 to the most recent, and all other browsers.
As code I can show you the code that I use, for the msDropdown css I use the default, dd.css provided, in the official website (https://github.com/marghoobsuleman/ms-Dropdown).
For the dropdown the ASP code is:
<asp:DropDownList runat="server" ID="ddLanguageSelector" CssClass="LanguageSelector" AutoPostBack="True" onchange="javascript:if(this.options[this.selectedIndex].value == 'More'){ showMoreLanguages(); return false; }" OnSelectedIndexChanged="ddLanguageSelector_SelectedIndexChanged" meta:resourcekey="ddLanguageSelectorResource" />
The jQuery / Javascript code is:
// Language Selector
$(document).ready(function (e) {
try {
$("header div.Wrapper div.HeaderUserAccess select.LanguageSelector").msDropDown();
} catch (e) {
alert(e.message);
}
});
As requested in comments, I will put here the regitration of the jquery as I use in the site:
<!--[if lt IE 8]><!-->
<script type="text/javascript" src="Content/Scripts/jQuery/jquery-1.11.0/jquery-1.11.0.min.js"></script>
<!--<![endif]-->
<!--[if gt IE 8]|!(IE)><!-->
<script type="text/javascript" src="Content/Scripts/jQuery/jquery-2.1.0/jquery-2.1.0.min.js"></script>
<!--<![endif]-->
Ok, so what I do really need is to found a whay where the msDropdown does not apear unformated in IE 9, 8 and 7.
Does anyone of you know the reason for this behavior of the control in the IE9?
Ok... For now I just have confirmed the following:
- I have a structure where I have a div, with css "position: relative;"
- Inside that div, i have several divs with css "position: absolute;"
- The dropdownlist is inside one of those divs containing css "position: absolute;"
For now I just believe that this is the problem, because i remove the dropdown list outside the div structure and it works perfect in all IE9, IE8, IE7 and even in IE6.
So now the question is... how to handle the dropdownlist inside the div structure? Knowing that it misbehaves in IE9 and lower in that structure?
And a good solution for this issue... Please....
Thanks in advance for the given attention.