English 中文(简体)
Framework7 - Active State
  • 时间:2024-10-18

Framework7 - Active State


Previous Page Next Page  

Description

When you tap the pnks and buttons, they are highpghted. This is done by active state in Framework7.

    It behaves pke a native app, not pke a web app..

    It has a built-in Fast cpcks pbrary and it should be enabled.

    The active-state class is the same as the CSS :active selector.

    Active state is enabled by adding watch-active-state class to <html> element.

The following code is used for active state in CSS style −

/* Usual state */
.my-button {
   color: red;
}

/* Active/tapped state */
.my-button.active-state {
   color: blue;
}

The following code shows the fallback compatibipty, when Active state or Fast cpcks is disabled −

/* 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;
}
Advertisements