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 🙂
I think you can achieve this thing in 2 ways:
1- By using CSS: In your css file just add following lines of code:
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:
I think it will help you.