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.

Changing Background of New Messages Link

Go down

Solved Changing Background of New Messages Link

Post by Mike on June 15th 2015, 4:36 pm

I'm working on a really advanced theme design for forumotion, and there's one thing I can't figure out!

I'm trying to get the link on the navigation bar to have a background color on it when there's a new private message.

Is there a simple(ish) way to do this?


Last edited by Mike on June 16th 2015, 10:58 am; edited 1 time in total
avatar
Mike
Hyperactive

Male Posts : 4251
Reputation : 468
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Solved Re: Changing Background of New Messages Link

Post by brandon_g on June 15th 2015, 6:00 pm

Are you trying to use picture based navigation bars, or the standard?


Remember to mark your topic when a solution is found.
avatar
brandon_g
Support Moderator
Support Moderator

Male Posts : 6632
Reputation : 600
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Changing Background of New Messages Link

Post by Mike on June 15th 2015, 6:09 pm

Standard Text Navigation.
avatar
Mike
Hyperactive

Male Posts : 4251
Reputation : 468
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Solved Re: Changing Background of New Messages Link

Post by brandon_g on June 15th 2015, 6:12 pm

Not sure if it's possible to modify that. Though if it is, it would probably be with CSS. Smile


Remember to mark your topic when a solution is found.
avatar
brandon_g
Support Moderator
Support Moderator

Male Posts : 6632
Reputation : 600
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Changing Background of New Messages Link

Post by Mike on June 15th 2015, 6:34 pm

@brandon_g wrote:Not sure if it's possible to modify that. Though if it is, it would probably be with CSS. Smile

Thanks I wouldn't have guessed.... Very good Very good Very good

avatar
Mike
Hyperactive

Male Posts : 4251
Reputation : 468
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Solved Re: Changing Background of New Messages Link

Post by Ange Tuteur on June 16th 2015, 5:02 am

Hi @Mike,

You're using PunBB, correct ? Unfortunately that version lacks the .new-message classname for the link, like in phpbb3. You can however, add this class using JavaScript.
Modules > JavaScript codes management > new script

Placement : In all the pages
Code:
$(function() {
  var pm = document.getElementById('i_icon_mini_new_message'); // find the new message node
 
  // check existence before testing the parent node for digits
  if (pm && /\d+/.test(pm.parentNode.innerHTML)) {
    pm.parentNode.className += ' new-message'; // add a new classname to the link
  }
});

After this, you should be able to use CSS to style the link.
Code:
a.new-message {
  color:#F60 !important;
}
avatar
Ange Tuteur
Forumaster

Male Posts : 13193
Reputation : 2904
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: Changing Background of New Messages Link

Post by Mike on June 16th 2015, 10:57 am

@Ange Tuteur wrote:Hi @Mike,

You're using PunBB, correct ? Unfortunately that version lacks the .new-message classname for the link, like in phpbb3. You can however, add this class using JavaScript.
Modules > JavaScript codes management > new script

Placement : In all the pages
Code:
$(function() {
  var pm = document.getElementById('i_icon_mini_new_message'); // find the new message node
 
  // check existence before testing the parent node for digits
  if (pm && /\d+/.test(pm.parentNode.innerHTML)) {
    pm.parentNode.className += ' new-message'; // add a new classname to the link
  }
});

After this, you should be able to use CSS to style the link.
Code:
a.new-message {
  color:#F60 !important;
}

You are amazing. Thank you so much!
avatar
Mike
Hyperactive

Male Posts : 4251
Reputation : 468
Language : English, HTML, CSS
Location : Loveland, Colorado

Back to top Go down

Solved Re: Changing Background of New Messages Link

Post by Ange Tuteur on June 16th 2015, 11:43 am

You're welcome ^^

Topic archived

Have a nice day. Smile
avatar
Ange Tuteur
Forumaster

Male Posts : 13193
Reputation : 2904
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Back to top


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