javascript – 触发CSS:非锚元素的主动选择器

如何通过JavaScript(jQuery)触发非锚元素的:active状态?

在查看Section 5.11.3 of the W3C CSS2 specification参考:hover伪选择器以了解触发a的激活时,我遇到了以下情况,这让我相信它应该是可能的:

“The :active pseudo-class applies while an element is being activated by the user. For example, between the times the user presses the mouse button and releases it.”

“CSS does not define which elements may be in the above states, or how the states are entered and left. Scripting may change whether elements react to user events or not, and different devices and UAs may have different ways of pointing to, or activating elements.”

谢谢你的帮助!

解决方法:

你无法触发css伪选择器,如:使用javascript激活.
没有可以执行的函数/处理程序,所以即使你触发了对具有css:active伪选择器集的元素的单击(例如将背景颜色设置为红色),也不会发生任何事情.

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...