WordPress.org

Support

Support » Plugins and Hacks » Link Library » Change Text Color Based On Value

Change Text Color Based On Value

  • Hello,

    I’m trying to change the “Link Large Description” text color based on value.

    If value = “No” then color = red
    If value = “Yes” then color = green

    I’ve been searching for a HTML / CSS / PHP solution for this and am trying to use;

    link-library/stylesheettemplate.css:

    var content = $(".content p").text();
    
        if (content == "Hayır") {
    
            $(this).css("color", "#ffffff");
        }
       if (content == "Evet") {
    
            $(this).css("color", "#ccc");
        }

    Library settings:
    Before “Link Large Description”;

    <b>Membership: </b><div class='content'>
    Afer “Link Large Description”;
    </div>

    but it’s not working, any suggestions, help, replies are greatly appreciated and thank you all in advance.

    http://wordpress.org/plugins/link-library/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Yannick Lefebvre

    @jackdewey

    I have never tried doing conditional content coloring myself in CSS. Perhaps someone more familiar with that functionality can chime in.

    Thank you for your respond,

    I’ll try to figure it out myself.

    But in the mean time, if I could get an answer to my other question (here), it would make it so much easier for me.

    But as I said thank you for your respond, and your plugin and your continuous support for it. It’s all much appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change Text Color Based On Value’ is closed to new replies.
Skip to toolbar