How do I alternate background colors for rows in my constant sum matrix table, but only alternate colors of the rows that are specific questions to fill out and keep the colors of the statement group headings the same?
Try below code:
jQuery(".ChoiceRow.ReadableAlt").each(function(){if(jQuery(this).find(".Group").length==0)jQuery(this).css("background","#d9d9d9");});
Try below code:
jQuery(".ChoiceRow.ReadableAlt").each(function(){if(jQuery(this).find(".Group").length==0)jQuery(this).css("background","#d9d9d9");});
Thank you this worked! Do you know if there is a way to select a second background color to alternate? Moreover, I’m finding each group starts with a different color each time, is there a way to make each group start with the same color every time?
Try below code:
jQuery(".ChoiceRow.ReadableAlt").each(function(){if(jQuery(this).find(".Group").length==0)jQuery(this).css("background","#d9d9d9");});
Thank you this worked! Do you know if there is a way to select a second background color to alternate? Moreover, I’m finding each group starts with a different color each time, is there a way to make each group start with the same color every time?
Try this:
var f;
jQuery("#"+this.questionId+" th.Group").each(function(){
f=1;
jQuery(this).parent().nextAll(".ChoiceRow").each(function(i){
if(jQuery(this).find("th.Group").length==0){
if( i%2==0 && f==1)
jQuery(this).css("background","#d9d9d9");
}else
f=0;
});
});
Try below code:
jQuery(".ChoiceRow.ReadableAlt").each(function(){if(jQuery(this).find(".Group").length==0)jQuery(this).css("background","#d9d9d9");});
Thank you this worked! Do you know if there is a way to select a second background color to alternate? Moreover, I’m finding each group starts with a different color each time, is there a way to make each group start with the same color every time?
Try this:
var f;
jQuery("#"+this.questionId+" th.Group").each(function(){
f=1;
jQuery(this).parent().nextAll(".ChoiceRow").each(function(i){
if(jQuery(this).find("th.Group").length==0){
if( i%2==0 && f==1)
jQuery(this).css("background","#d9d9d9");
}else
f=0;
});
});
No, please attach screenshot where you have paste the code.
No, please attach screenshot where you have paste the code.
Code should be pasted in the onload function like below:
Code should be pasted in the onload function like below:
Try this:
var f;
jQuery("#"+this.questionId+" th.Group").each(function(){
f=1;
jQuery(this).parent().nextAll(".ChoiceRow").each(function(i){
if(jQuery(this).find("th.Group").length==0){
if( i%2==0 && f==1)
jQuery(this).css("background","#d9d9d9");
else
jQuery(this).css("background","#c4acac");
}else
f=0;
});
});
Try this:
var f;
jQuery("#"+this.questionId+" th.Group").each(function(){
f=1;
jQuery(this).parent().nextAll(".ChoiceRow").each(function(i){
if(jQuery(this).find("th.Group").length==0){
if( i%2==0 && f==1)
jQuery(this).css("background","#d9d9d9");
else
jQuery(this).css("background","#c4acac");
}else
f=0;
});
});
Worked! Thank you so much for all your help! @sha
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.