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.

Background color for topics that contain a certain string

View previous topic View next topic Go down

Background color for topics that contain a certain string

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

Male Posts : 692
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

Re: Background color for topics that contain a certain string

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

bump.

Ace 1
Forumember

Male Posts : 692
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

Re: Background color for topics that contain a certain string

Post by 10spetter10 on 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
Forumember

Posts : 195
Reputation : 81
Language : Dutch

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