Created
September 5, 2011 14:01
-
-
Save yujikosuga/1195057 to your computer and use it in GitHub Desktop.
Add UI state change in jQuery UI (I used this for buttons)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.addUiState = function() { | |
$(this).hover(function() { | |
$(this).addClass("ui-state-hover"); | |
}, function() { | |
$(this).removeClass("ui-state-hover"); | |
}).mousedown(function() { | |
$(this).addClass("ui-state-active"); | |
}).mouseup(function() { | |
$(this).removeClass("ui-state-active"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment