无法设置 jqueryUI 对话框关闭按钮的活动状态的样式
我希望在 jqueryUI 对话框中设置关闭按钮(在标题栏中)的活动状态的样式。我已经将其正常样式和 :hover 状态设置得很好。但 :active 状态似乎永远不会触发。
插件中是否有某些内容阻止关闭按钮链接中的 :active 状态工作?可以改变它以便它起作用吗?
以下是问题的示例:查看示例
I wish to style the active state of the close button (in the titlebar) in jqueryUI's dialog. I have styled its normal and :hover state fine. But the :active state never seems to trigger.
Is there something in the plugin that prevents the :active state in the close button's link from working? Can this be changed so it will work?
Here's an example of the problem: View example
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是在不支持“selectstart”事件的浏览器中禁用对话框小部件标题栏选择的结果。对于这些浏览器,他们会禁用“mousedown”事件。
第 145 行:jquery.ui.dialog.js
第 120 行:jquery.ui.core.js
因此您可以使用enableSelection() 或自行取消绑定
It is consequence of disabling selection for TitleBar of Dialog Widget in browser which don't support 'selectstart' event. For those browser they disable 'mousedown' event instead.
line 145: jquery.ui.dialog.js
line 120: jquery.ui.core.js
so you can use enableSelection() or unbind it yourself
:active
状态仅在单击时触发。此时您的对话框将立即关闭,所以我怀疑您是否能看到它的状态。如果这不能回答您的问题,您能举个例子吗?The
:active
state is only triggered when it is clicked. On that point your dialog will close immediately, so I doubt you can see it's state. Can you provide an example if this doesn't answers your question?鉴于 @Bizniztime 的评论,为什么不在 javascript 中执行此操作?
您还可以添加/删除课程...
Given the comments of @Bizniztime, why not do this in javascript?
You could also add/remove classes...