Change border colour of original poster to match category
Solved
Customisation
-
One simple feature I wanted in Sudonix was for the border of the first post in a new thread to match the colour set by the category. This makes the first post stand out, and looks nice too
The code is based around the same functionality here
https://sudonix.com/topic/256/recent-cards-plugin-customization
It’s relatively simple in it’s approach. Here is is
$(document).ready(function() { $(window).on('action:ajaxify.end', function(data) { var categoryColor = $('[role="presentation"].icon').css("background-color"); $('li.topic-owner-post:nth-child(1)').css('border-color', categoryColor); }); });
Essentially, this jQuery snippet looks for the
role="presentation"
attribute in the topic stream (there’s only the one, so no need for any loop to detect all of them like we do in the previous link), grab the CSS value, and then set it as the border so it looks like thisAll you need to do is copy the snippet, and place this in your ACP -> Appearance -> Custom JS
Enjoy…
-
undefined phenomlab has marked this topic as solved on
-
undefined phenomlab referenced this topic on