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

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

Post by Ace 1 January 1st 2016, 10:30 am

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

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

Post by Ace 1 January 3rd 2016, 1:20 am

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

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

Post by 10spetter10 January 3rd 2016, 11:20 am

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