Welcome, Guest. Please login or register.

ShoutBox!

 

Skhilled

2024-08-09, 18:19:29
Awww! Poor thing! LOL
 

Ken

2024-08-09, 09:20:52
 

Skhilled

2024-07-06, 10:33:18
 :D
 

Ken

2024-07-06, 06:40:47
Happy Saturday after the 4th of July!
 :fireworks:
 

Skhilled

2024-07-04, 20:27:02
Happy Day Off From Work!  :D
 

Ken

2024-06-25, 06:23:12
84... who knew?  laughing7
...2013 was my *magic* year
 

Skhilled

2024-06-14, 22:09:12
I hope so! LOL
 

Ken

2024-06-14, 21:41:30
My B-Day is forthcoming and maybe it will be far enough along so that I can be a regular Dancing Fool for that day!!! :banana: :2funny:
 

Ken

2024-06-14, 21:38:38
Happy Friday everyone! I'm  SOOO glad to see Friday and not just because it's the weekend, but because it marks one more day in the recovery of my foot!  laughing7

Scrubmeister

2024-04-19, 10:32:40
Good to see the site back faster than ever. :)

Recent Topics

TP Articles


Search in titles
Search in article texts

Author Topic: How To Make Things Change Colors Upon Hovering  (Read 4601 times)

0 Members and 2 Guests are viewing this topic.

Offline Skhilled (OP)

  • Administrator
  • *
  • Posts: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
How To Make Things Change Colors Upon Hovering
« on: August 17, 2019, 09:07:02 AM »
I've found a way to do this in the SMF 2.1 RC2 version but will work in any modern version of SMF.

I found this by accident working on a new theme that uses the ".bg.even/.bg.odd" code in index.css. There's code for alternating colors like in a topic, in the admin, etc. For instance, open any topic with more than one post in it on this forum. You'll notice that the posts alternate between two colors. That part uses the ".bg.even/.bg.odd" code or ".windowbg/.windowbg2" (mostly for SMF 2.0.15).

You can see it in action here on the help, calendar, and member pages:

https://skhilled.com/rc2/index.php?theme=14

What you'll need to do is create a "hover" for the code in question so it changes it to another when you put your mouse over it. ;) The following is code from 2.1 RC2:

Code: [Select]
/* Here comes the glory... */
.windowbg:nth-of-type(even), .bg.even {
background: #1f1f1f;
}
.windowbg:nth-of-type(odd), .bg.odd {
background: #282828;
}

Change it to this:

Code: [Select]
/* Here comes the glory... */
.windowbg:nth-of-type(even), .bg.even {
background: #1f1f1f;
}
.windowbg:nth-of-type(even):hover, .bg.even {
background: #000;
}
.windowbg:nth-of-type(odd), .bg.odd {
background: #282828;
}
.windowbg:nth-of-type(odd):hover, .bg.odd {
background: #000;
}

Just change the background of the following code to whatever you want the hover color to be:

Code: [Select]
background: #000;

Offline Ken

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11942
  • Gender: Male
  • View Gallery
Re: How To Make Things Change Colors Upon Hovering
« Reply #1 on: August 17, 2019, 11:47:22 AM »
Neat looking trick.  :thumbup:
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled (OP)

  • Administrator
  • *
  • Posts: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • View Gallery
    • Buildz Hosting
Re: How To Make Things Change Colors Upon Hovering
« Reply #2 on: August 17, 2019, 12:24:20 PM »
Next I plan on trying to make the boards on the home page do the same.  :wink: