Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Change color of chosen answer....

Change color of chosen answer.... 10 months 17 hours ago #102843

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4272
  • Thank you received: 806
  • Karma: 369
Hi David,

There is no way to select a parent of an element with CSS.

You will need to modify all of the listeners in imagetick_lime.js to add a class to the parent <li> element when a radio or checkbox is checked. Something like:
$('#tick_img_'+id).closest('li').addClass('checkedItem');

And then in template.css, something like this:
li.checkedItem {
	color:red;
}
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Change color of chosen answer.... 10 months 17 hours ago #102849

  • dweisser
  • dweisser's Avatar
  • OFFLINE
  • Bronze Donor
  • Posts: 205
  • Thank you received: 5
  • Karma: 5
I'll give it a shot. Thank you!
The administrator has disabled public write access.

Change color of chosen answer.... 10 months 16 hours ago #102854

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
:checked like this can be used only with css.

Here you need JS.

Denis
The administrator has disabled public write access.

Change color of chosen answer.... 10 months 4 hours ago #102866

  • dweisser
  • dweisser's Avatar
  • OFFLINE
  • Bronze Donor
  • Posts: 205
  • Thank you received: 5
  • Karma: 5
Thanks again guys,

I accomplished this by adding:

$('#tick_img_'+id).closest('li').addClass('uncheckedItem');
$('#tick_img_'+id).closest('li').removeClass('checkedItem');

and

$('#tick_img_'+id).closest('li').addClass('checkedItem');
$('#tick_img_'+id).closest('li').removeClass('uncheckedItem');

As you suggested. I hope it helps someone.
David
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.127 seconds
Donation Image