Skip to content

Instantly share code, notes, and snippets.

@yujikosuga
Created September 5, 2011 14:01
Show Gist options
  • Save yujikosuga/1195057 to your computer and use it in GitHub Desktop.
Save yujikosuga/1195057 to your computer and use it in GitHub Desktop.
Add UI state change in jQuery UI (I used this for buttons)
$.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