Once again, dealing with Internet Explorer has become a major headache. On headset.no, we have incorporated a small blue search field. However, when you input "jabra" into the field, it should generate suggestions in a div underneath. This feature operates flawlessly on Chrome, Safari, Opera, and Firefox, but predictably, IE is causing issues.
To distinguish CSS styles between browsers on this site, I utilize the CSS Browser Selector plugin.
Upon inspecting IE using F12, it appears that there are several inline styles applied to the
<div class="autocomplete" id="searchSuggestions"
style="
z-index: 2;
position: absolute;
filter: ;
width: 130px;
display: none;
top: 193px;
left: 1px;"
getElementsByClassName="function() {...
These styles are absent from the source code.
I would appreciate it if someone could assess the situation and provide insight into what may be causing the issue. My patience is wearing thin.
The JavaScipt:
var searchSuggestionInit = function()
{
if ($('searchField'))
{
$('searchField').addClassName('quickSearch');
$('searchField').down('.srch-txt').addClassName('text');
}
var field = $('searchContainer').down('.quickSearch').down('input.text');
if (!field.id)
{
field.id = 'searchQuery';
}
field.setAttribute('autocomplete', 'none');
new Ajax.Autocompleter(field.id, 'searchSuggestions', Router.createUrl('searchSuggestions', 'index'),
{
});
}
Event.observe(window, 'load', searchSuggestionInit);
And the CSS:
/************************************************** SEARCH SUGGESTIONS*/
div.autocomplete {
position:absolute;
width:250px;
background-color:white;
border:1px solid #888;
margin:0;
padding:0;
z-index: 50000;
font-size: 0.85em;
overflow: hidden;
}
.ie .div.autocomplete {
position:absolute;
width:250px;
background-color:white;
border:1px solid #888;
margin:0;
padding:0;
z-index: 50000;
font-size: 0.85em;
overflow: hidden;
}
div.autocomplete ul {
list-style-type:none;
margin:0;
padding:0;
}
div.autocomplete ul li.selected { background-color: #ffb;}
div.autocomplete ul li {
list-style-type:none;
display:block;
margin:0;
padding:2px;
cursor:pointer;
white-space: nowrap;
}
Here is some of the source code:
<div id="search" title="Search Automatically in Database">
<div id="searchField">
{form action="controller=category" class="Search" handle=$form}
<input type="hidden" name="id" value="1" />
{textfield type="text" onblur="if(this.value=='') this.value='';" onfocus="if(this.value=='') this.value='';" class="srch-txt" name="q" id="s" size="16"}
</div>
<button type="submit" class="m" id="searchsubmit"> </button>{/form}
</div>
{loadJs form=true}
<div id="searchSuggestions" class="autocomplete" style="display: none;"></div>
{literal}
<script type="text/javascript>
$j("#search").tooltip({ offset: [45, 200], effect: 'slide' });
</script>
{/literal}
<div class="clear"></div>
</div>
</div>
Thank you for your assistance :)