I’ve never tried my hand at javascript but I’m just wanting to know if it is actually possible to do this before I spend time learning the code.
I’ve spent a couple of days looking around the forums and trying to use code already generated on a demo site to see how changing certain properties affects a section as a whole.
My CSS specifies the ‘a:link’, ‘a:active’ and ‘a:visited’ as a set colour and the a:hover as its complementary color (#128EED = color, #ED7112 = complementary).
I want one of 8 pre-determined colors to be randomly selected when any of the pages are loaded, and the complementary color of the pre-determined, random color to be the a:hover color.
Any information would be greatly appreciated before I start to attempt to do this.
Thank you and kind regards.
Yes, you can do that. You can set the style on an element through javascript, you could create several classes to color what you need and apply those classes randomly, etc. There are multiple solutions to your problems, but it’s very doable.
Also, it’s never a waste of time to learn javascript if you are web programming. It can take a lot of stress off of a page needing to go back and forth to the server as well as add functionality that HTML can’t provide or can’t easily provide.