Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by James Prince on Jan 15, 2008 09:17
open dhtmlx forum
Rollovers on combo?

Does combo box have the ability to add a colour on rollover so people can see which item they are rolling over like the default html combo does?

James
Answer posted by Support on Jan 15, 2008 09:46
It can be only partially by adding next css class

.dhx_combo_list div:hover{
    background-color:#C8D7E3;
}

( it will not work for IE )


Answer posted by Support on Jan 15, 2008 09:46
Basically with some code modification it can be hardcoded for all browsers.
Answer posted by James on Jan 15, 2008 10:59
Ive managed to write a fix that works in IE as well for a rollover in the combo.

Replace
.dhx_combo_list div{
cursor:pointer;
padding:2px 2px 2px 2px;
}

with this:
.dhx_combo_list div{
cursor:pointer;
padding:2px 2px 2px 2px;
background-color: expression(
this.onmouseover = function() { this.className += ' rollover'; },
this.onmouseout = function() { this.className = this.className.replace('rollover', ''); });
}

then add this:
.rollover {
 background-color: red;
}


and for firefox just add

.dhx_combo_list div:hover {
background-color:red;
cursor: pointer;
}

Little hack there that people may find comes in handy

James