Trying to Add something like a Heading on top of a category

Hello all,

I am trying to set a heading for different groups of forum categories I have. Perhaps someone can point me to the right direction. I was trying to use jquery method but I get stuck with only loaded the heading-element when page load is ready what results the heading only shown once on homepage, when returning the element disappeared. Second way I get stuck with elements loading multiple times :smile:

Let me break it for you:

I am using that function to add the element:

$('tr[data-category-id="9"]').before ('<tr><td class="category" style="border-color: #F37022;">My Heading</td><td class="topics"></td><td class="latest"></td></tr>');

So, inside document ready function is the first scenario, works well, but when browsing the forum and than going back to start page, the element is gone.

When doing the following, the element loads multiple times:

function OnLoad (){
    $('tr[data-category-id="9"]').before ('<tr><td class="category" style="border-color: #F37022;">Eve Online</td><td class="topics"></td><td class="latest"></td></tr>');
}
$(document).ajaxComplete(function () {
    OnLoad();
});

Perhaps someone knows what to do, that would be great :slight_smile:

Cheers, Daniel

Ok, to solve that question:

Thanks to @cpradio

3 Likes

This topic was automatically closed after 2251 days. New replies are no longer allowed.