Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Background color posts

    Basically im trying to colour my posts, I've managed to get most of it done, but somethings wrong with the last part I need.
    The CSS in the console is saying the colour is active, so i thought maybe a code was interfering with it; so I made a testboard and had it so only those codes were in place. But still doesnt work

    This is what the post looks like - But its missing the colour by the name and postinfo (Where the border extends up to)



    Heres the codes im using


    Code:
    $(".topic .user_info dd:contains(Site Administrator)").parent().parent().parent().children("td").attr("style","background-color:#023B34 !important; border-color:#03FFE2 !important;").parent().next().children("td").attr("style","background-color:#023B34 !important; border-color:#03FFE2  !important;").parent().prev().prev().children("td").attr("style","background-color:#023B34 !important; border-color:#03FFE2 !important;");
    Code:
    var group=[["Site Administrator","admin"]];$('dl.user_info > dt:contains(Group:) + dd').each(function(){for(var k=group.length,x=0;x<k;x++){if(this.innerHTML.indexOf(group[x][0])!==-1){$(this).closest('tr').find('dl.user_info').addClass(group[x][1]);}}});
    Code:
    var group=[["Site Administrator","admin"]];$('dl.user_info > dt:contains(Group:) + dd').each(function(){for(var k=group.length,x=0;x<k;x++){if(this.innerHTML.indexOf(group[x][0])!==-1){$(this).closest('tr').find('dl.user_profile').addClass(group[x][1]);}}});
    Code:
    var group=[["Site Administrator","admin"]];$('dl.user_info > dt:contains(Group:) + dd').each(function(){for(var k=group.length,x=0;x<k;x++){if(this.innerHTML.indexOf(group[x][0])!==-1){$(this).closest('tr').find('td.c_post').addClass(group[x][1]);}}});
    Code:
    $("dl.user_info dd:contains('Site Administrator')").closest("tr").find("td.c_post").css('color','cyan').css('font-size','14px').css('font-family','Arial').css('text-align','centre').css('padding-top','5px').css('border','1px solid ##FFFF00');
    Code:
    $(".topic .user_info dd:contains(Site Administrator)").parent().parent().parent().children("td").attr("style","background-color:#023B34 !important; border-color:#03FFE2 !important;").parent().next().children("td").attr("style","background-color:#023B34 !important; border-color:#03FFE2  !important;").parent().prev().prev().children("td").attr("style","background-color:#023B34 !important; border-color:#03FFE2 !important;");
    Code:
    var group = [
    ["Site Administrator", "admin"]
    ];
    
    $('dl.user_info > dt:contains(Group:) + dd').each(function () {
       for (var k = group.length, x = 0; x < k; x++) {
        if (this.innerHTML.indexOf(group[x][0]) !== -1) {
     $(this).closest('tr').find('td.c_postinfo').addClass(group[x][1]);
         }
        }
    });
    </script>
    Thats the code
    with this in CSS
    Code:
    .admin  {
    background-color:#023B34 !important; border-color:#03FFE2 !important;
    }


    Any Idea as to what im missing?

    testboard link http://w11.zetaboards.com/AnimeNERF/index/

  • #2
    Regular Coder Vincent Puglia's Avatar
    Join Date
    Jul 2003
    Location
    where the World once stood
    Posts
    367
    Thanks
    0
    Thanked 13 Times in 13 Posts
    I don't know what you're missing, but, after viewing source, I did notice you have multiple copies of the javascript (including the var group declaration) all over the place. And what is that link? To your website? I entered test & test as name/password and got refused, so if that is the 'test' page where am I supposed to be looking?

    Also, did you try alerting or console.logging your values (specifically 'this'), to know whether you are pointing to the correct objects?
    Where the world once stood
    the blades of grass
    cut me still


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •