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.

Background color for topics that contain a certain string

2 posters

Go down

Background color for topics that contain a certain string Empty Background color for topics that contain a certain string

Post by Ace 1 Fri 1 Jan - 11:30

I want the topic to have a certain bgcolor if the topictitle contains the string "New"

Thanks :3
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

Background color for topics that contain a certain string Empty Re: Background color for topics that contain a certain string

Post by Ace 1 Sun 3 Jan - 2:20

bump.
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

Background color for topics that contain a certain string Empty Re: Background color for topics that contain a certain string

Post by 10spetter10 Sun 3 Jan - 12:20

Is it for a phpBB3 forum? Then you can try this javascript. It will add 'selected' to the rows of the topic with 'new' in their titles.

Code:
$(function() {
  var str = 'new';
  $('ul.topiclist.topics li.row').each(function() {
      var title = $(this).find('a.topictitle').html();
      if(title.toLowerCase().indexOf(str) >= 0) {
        $(this).addClass('selected');
      }
  });
});
10spetter10
10spetter10
Forumember

Posts : 195
Reputation : 82
Language : Dutch

Back to top Go down

Back to top

- Similar topics

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