Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9153181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:13:36+00:00 2026-06-17T12:13:36+00:00

I apply the below script to add color to the comments I add in

  • 0

I apply the below script to add color to the comments I add in my application (JIRA).

<script type="text/javascript">
$(document).ready(function() {
    $(".activity-comment:even").css("background-color","#6699FF"); 
    $(".activity-comment:odd").css("background-color","#B2CCFF"); 
});

comments http://i.minus.com/jFoE7kcaTqdrp.JPG

After applying the script the comments appear as above , however the script does not work when i move to other tabs (i.e. Worklog , History) or i add a new comment. I need to refresh the page for the script to execute .

Can someone please help me how i can permanently set the colors ?

Note : I am applying the javascript on the application announcement banner this makes the script run on every page of the application , I can make changes to the source files.

Thanks in Advance 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:13:38+00:00Added an answer on June 17, 2026 at 12:13 pm

    I think you can achieve this thing in 2 ways:

    1- By using CSS: In your css file just add following lines of code:

    .activity-comment:even{
        background-color: #6699FF;
    }
    .activity-comment:odd{
        background-color: #B2CCFF;
    }
    

    2- By Jquery: In this case use .live() function of jquery to achieve style on dynamic added comments. Like get the id of comment submit button (suppose: comment_add) , and then:

    $("#comment_add").live('click',function(){
        $(".activity-comment:even").css("background-color","#6699FF"); 
        $(".activity-comment:odd").css("background-color","#B2CCFF");
    });
    

    I think it will help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't get CSS to apply to the function below. Is it because it's
I have below code in html <div id=divTest> Hello <input type=text id=txtID/> <input type=text
The function below is designed to apply rel=nofollow attributes to all external links and
===UPDATE=== If I remove the style=display: none; from the template and apply the below
I am getting the error: object render has no method apply for the below
I'm trying to convert the below bit of code into VB (and obviously apply
In my script (for Ruby >= 1.9) below I defined a Table class, which
How can the code below be modified such that it will apply the onblur
I am using below jquery mobile datebox plugins for date control in mobile application.
Below I use the id of a clicked item to tell my function which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.