change behavior of mouse hover

I'm using iq-button-toggle and I would like to switch off the mouse hover function. The appearance of the button should not change. No matter if the status of the button is ON or OFF. I use this lines in a custom css file:

.iq-button-toggle.inverted:not(.locked)
.iq-button:focus,
.iq-button-toggle.inverted:not(.locked)
.iq-button:hover,
.iq-button-toggle:not(.locked)
.iq-button:focus,
.iq-button-toggle:not(.locked)
.iq-button:hover{border-color:rgba(60,60,60,.7);background-color:inherit;color:inherit}

This works when the button is OFF. But when the button is ON and the mouse is over it, the color changes. How can I modify the css file to get the correct behavior even when the state is ON?

Best reply by HmiGuide

You can use the following workaround, for the hover problem:
- Create two stylesheets of type iq-button-toggle
- e.g. TogBut_On and TogBut_Off
- Define the color and background color e.g.

.iq-button-toggle.TogBut_Off.iq-variant-01 .iq-button {
ย ย  background-color: gray;
}
/* [Variant 01] - Toggle Button Label */
.iq-button-toggle.TogBut_Off.iq-variant-01 .iq-toggle-label {
color: blue;
}

- Select stylesheet TogBut_On, when button is on.
- Select stylesheet TogBut_Off, when button is off.

See link for info how to change color via stylesheets: /smart-hmi-webiq-designer-and-server-zqilynus/post/change-the-color-of-an-item-according-to-a-value-zJQOi3hnmaLFpmI

Attached you find an example created with Designer V2.11.3

disablehover_workaround.zip
2.44MB
View original
3 replies