WordPress.org

Ready to get started?Download WordPress

Forums

Link Library
Change Text Color Based On Value (3 posts)

  1. comziz
    Member
    Posted 7 months ago #

    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/

  2. Yannick Lefebvre
    Member
    Plugin Author

    Posted 7 months ago #

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

  3. comziz
    Member
    Posted 7 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic