问题
When a Select2 dropdown is open, the JavaScript hover event and the css pseudoclass do not work anymore. E.g.
p:hover {
color: red
}
only has effect when the dropdown is closed and not when it's opened.
See here for self contained example: http://jsfiddle.net/cre5hckw/6/
This may be related to https://github.com/ivaynberg/select2/issues/1715.
I'm looking forward to any feedback!
回答1:
Select2 uses a class, not :hover pseudoclass.
.select2-results .select2-highlighted {
color: red;
}
来源:https://stackoverflow.com/questions/27344338/hover-events-are-blocked-when-select2-dropdown-is-open