Jump to content

[HTML][CSS] Problem to change color while mouseover on buttons


Recommended Posts

  • 3 weeks later...

Its hard to understand excatly what you want, but is it something like this?

https://jsfiddle.net/TheUnknownNO/fjoqaooh/142/

GIF: https://gyazo.com/77e8c96341af557e8031dcb5a9c6be5c
 

I wrote some js quickly to manage the colours of the navbar background, aswell as rewriting the entire thing cause it was just confusing the way it was.

So like, in this one, the rest of the buttons change to a lighter colour than the one currently being hovered over. Like this:

277772770b41ef439b41f8b797a867d5.png

 

Note: it does require jquery

Edited by TheUnknownNO
Link to comment
Share on other sites

@[GER]Loading...

Everything is possible with a little bit of jQuery magic :)

If you got any questions about how the code works, let me know and I'll gladly help out.

Tbh, if I were to use it production I would have rewritten it so you would only need one hover event, and make just one CSS class to do the hover colours of the background and non-hovered buttons, but hey, that code works, is easy to understand, and allows for easy customization and its easy to add more colours to it.

 

Edited by TheUnknownNO
Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.