我希望在 jqueryUI 对话框中设置关闭按钮(在标题栏中)的事件状态的样式。我已经将其正常样式和 :hover 状态设置得很好。但 :active 状态似乎永远不会触发。
插件中是否有某些内容阻止关闭按钮链接中的 :active 状态工作?可以改变它以便它起作用吗?
以下是问题示例:View example
最佳答案
这是在不支持“selectstart”事件的浏览器中禁用对话框小部件标题栏选择的结果。对于这些浏览器,他们会禁用“mousedown”事件。
第 145 行:jquery.ui.dialog.js
uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection();
第 120 行:jquery.ui.core.js
disableSelection: function() {
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
".ui-disableSelection", function( event ) {
event.preventDefault();
});
},
enableSelection: function() {
return this.unbind( ".ui-disableSelection" );
}
这样你就可以使用enableSelection()或者自己解除绑定(bind)
关于jquery - 无法设置 jqueryUI 对话框关闭按钮的事件状态的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7707637/