Hi wonderful people!
link to Code Pen: https://codepen.io/IDCoder/pen/LrQNOR)
I’m trying to use a button that upon active
(or being clicked), it makes another “button” (the surrounding container) active
(act as if it is being clicked instead). I’m designing a UX of this:
- as you
mousever
onto form, form -hover
effect takes place causing blue surround LED light to glow (currently works as wanted) - as you then continue over to button (still
mouseover
), surround LED light remains a glow (currently works as wanted) - as you click on button (on down stroke of key) this will remove the hover effect (blue LED glow) of surrounding container , and on upstroke of key, the
hover
effect (surround LED blue glow) returns
So, essentially what will happen when you click the green button is that the blue LED will flash (as it moves from erasing current hover state to re-adding it) …currently not working
current javascript code:
$('form').on('submit', function(event) {
event.preventDefault();
$(this).find('metal').removeClass('hover');
$(this).find('metal').addClass('no-hover');
});
Code for related CSS classes for `hover` and `non-hover`:
.metal:hover {
color: hsl(210, 100%, 40%);
text-shadow: hsla(210,100%,20%,.3) 0 -1px 0, hsl(210,100%,85%) 0 2px 1px, hsla(200,100%,80%,1) 0 0 5px, hsla(210,100%,50%,.6) 0 0 20px;
box-shadow:
inset hsla(210,100%,30%, 1) 0 0px 0px 4px, /* border */
inset hsla(210,100%,15%, .4) 0 -1px 5px 4px, /* soft SD */
inset hsla(210,100%,20%,.25) 0 -1px 0px 7px, /* bottom SD */
inset hsla(210,100%,100%,.7) 0 2px 1px 7px, /* top HL */
hsla(210,100%,75%, .8) 0 0px 3px 2px, /* outer SD */
hsla(210,50%,40%, .25) 0 -5px 6px 4px, /* outer SD */
hsla(210,80%,95%, 1) 0 5px 6px 4px; /* outer HL (blue LED ) */
}
(.no-hover):hover{
color: hsl(210, 100%, 40%);
text-shadow: hsla(210,100%,20%,.3) 0 -1px 0, hsl(210,100%,85%) 0 2px 1px, hsla(200,100%,80%,1) 0 0 5px, hsla(210,100%,50%,.6) 0 0 20px;
}
When I click on the green button the effect I want to achieve doesn’t happen. What I’m I doing wrong? Thanks in advance for your help!