The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[Solved] Make specific hover change for specific topics.

2 posters

Go down

Solved [Solved] Make specific hover change for specific topics.

Post by Ace 1 May 26th 2015, 1:39 pm

Uh, I wanna know how to make topics with a specific line of text change into a specific color.

For example, topics with "solved" in them, will hover to green and
 Topics with "unsolved" will hover to red.

Can someone tell me how to do this? If not can you tell me how to make a whole specific thread like "Application #1 [Solved]" fade to green?

Thanks Very Happy


Last edited by Ace 1 on May 27th 2015, 1:14 pm; edited 1 time in total
Ace 1
Ace 1
Helper
Helper

Male Posts : 843
Reputation : 64
Language : English - French?
Location : Druid Hill Park

https://help.forumotion.com

Back to top Go down

Solved Re: [Solved] Make specific hover change for specific topics.

Post by Ange Tuteur May 26th 2015, 9:06 pm

That would require javascript to perform a search of the node's textual content. Then if it contains a certain sequence of characters, you can add a classname to it. Here's an example using a regular expression + loop for the links.

- placement should be in all the pages or sub-forums
Code:
$(function() {
  for (var a, b = document.getElementsByTagName('A'), i = 0; a = b[i]; i++) {
    if (/\[solved\]/i.test(a.innerHTML)) a.className += ' solved';
  }
});

Then you should be able to use CSS :
Code:
a.solved:hover { color:green !important }
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: [Solved] Make specific hover change for specific topics.

Post by Ace 1 May 27th 2015, 1:12 pm

@Ange Tuteur thanksya so so so much! ;D

Solved
Ace 1
Ace 1
Helper
Helper

Male Posts : 843
Reputation : 64
Language : English - French?
Location : Druid Hill Park

https://help.forumotion.com

Back to top Go down

Solved Re: [Solved] Make specific hover change for specific topics.

Post by Ange Tuteur May 27th 2015, 9:33 pm

You're welcome Wink

Topic archived
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum