Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Add hover / blur callback events #2 #275

merged 1 commit into from

2 participants


merged hover and blur events

see #262


Is this the updated PR for #262 ?


Yes it is, big thanks for merging it!


Fix seems nice so far, could be merged. Only last question: why do you add optionValue to the event?


Hi Felix,
I need the current hovered value to know which element has been affected. Is there another way to get the optionValue without passing it. At the moment a get it in my hover callback by ... e.originalEvent.optionValue ...
Otherwise the only element you can access is the selected one or am I wrong?


Ahh ok, seems legit. Merged. Thanks for your contribution!

@fnagel fnagel merged commit 066bb3d into fnagel:selectmenu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 15, 2012
  1. @Peinkillar

    Update ui/jquery.ui.selectmenu.js

    Peinkillar authored
    merged hover and blur events
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 ui/jquery.ui.selectmenu.js
8 ui/jquery.ui.selectmenu.js
@@ -337,18 +337,22 @@ $.widget("ui.selectmenu", {
.bind("click.selectmenu", function() {
return false;
- .bind('mouseover.selectmenu', function() {
+ .bind('mouseover.selectmenu', function(e) {
// no hover if diabled
if (!$(this).hasClass(self.namespace + '-state-disabled') && !$(this).parent("ul").parent("li").hasClass(self.namespace + '-state-disabled')) {
+ e.optionValue = self.element[0].options[$(this).data('index')].value;
+ self._trigger("hover", e, self._uiHash());
self._focusedOptionLi().removeClass(self.widgetBaseClass + '-item-focus ui-state-hover');
$(this).removeClass('ui-state-active').addClass(self.widgetBaseClass + '-item-focus ui-state-hover');
- .bind('mouseout.selectmenu', function() {
+ .bind('mouseout.selectmenu', function(e) {
if ($(this).is(self._selectedOptionLi())) {
+ e.optionValue = self.element[0].options[$(this).data('index')].value;
+ self._trigger("blur", e, self._uiHash());
$(this).removeClass(self.widgetBaseClass + '-item-focus ui-state-hover');
Something went wrong with that request. Please try again.