Framework7 - active 活动状态
描述
当您点击链接和按钮时,它们会突出显示。这是通过 Framework7 中的 活动状态 实现的。
- 它的行为类似于本机应用程序,而不是 Web 应用程序。
- 它有一个内置的 快速点击 库,应该启用它。
- active-state 类与 CSS :active 选择器相同。
- 通过将 watch-active-state 类添加到 <html> 元素来启用活动状态。
以下代码用于 CSS 样式中的活动状态 −
/* Usual state */ .my-button { color: red; } /* Active/tapped state */ .my-button.active-state { color: blue; }
以下代码显示了禁用活动状态或快速点击时的回退兼容性 −
/* Usual state */ .my-button { color: red; } /* Active/tapped state */ .my-button.active-state { color: blue; } /* Fallback, when active state is disabled */ html:not(.watch-active-state) .my-button:active { color: blue; }