cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

change behavior of mouse hover

change behavior of mouse hover

SchneJoe
Established Member

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?

3 REPLIES 3

webiq-sk
Frequent Contributor

I formatted your code:

.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;
}

If you add "!important" after each of those colors it might work. or you could use more precise CSS selectors. Also see this for more info: https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity 

SchneJoe
Established Member
Thanks for the answer, but the behavior is not 100% what I expect. Normally the button is white when the status is OFF and blue when the status is ON. I want it to keep the color, wether the mouse is over the button or not. No with this settings as you suggested, the button keeps white when it is OFF (white), but it changes to white when it was ON (blue) before the mouse moves over it. Any ideas?

HmiGuide
Community Moderator
Community Moderator

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: https://developer.community.boschrexroth.com/t5/Smart-HMI-WebIQ-Designer-and/Change-the-color-of-an-...

Attached you find an example created with Designer V2.11.3

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist