The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

[Solved] Make specific hover change for specific topics.

View previous topic View next topic Go down

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

Post by Ace 1 on 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
Forumember

Male Posts : 689
Reputation : 38
Language : my css ready java yo scripts boi
Location : Druid Hill Park smoking indo

http://genocideclan.forumotion.com

Back to top Go down

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

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

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

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

@Ange Tuteur thanksya so so so much! ;D

Solved

Ace 1
Forumember

Male Posts : 689
Reputation : 38
Language : my css ready java yo scripts boi
Location : Druid Hill Park smoking indo

http://genocideclan.forumotion.com

Back to top Go down

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

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

You're welcome Wink

Topic archived

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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