Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1
  • 2

THEMA: Change color of chosen answer....

Change color of chosen answer.... 4 Monate 1 Tag her #102843

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 3844
  • Dank erhalten: 690
  • Karma: 330
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Change color of chosen answer.... 4 Monate 1 Tag her #102849

  • dweisser
  • dweissers Avatar
  • OFFLINE
  • Silver Donor
  • Beiträge: 182
  • Dank erhalten: 5
  • Karma: 5
I'll give it a shot. Thank you!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Change color of chosen answer.... 4 Monate 1 Tag her #102854

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 5875
  • Dank erhalten: 722
  • Karma: 223
:checked like this can be used only with css.

Here you need JS.

Denis
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Change color of chosen answer.... 4 Monate 1 Tag her #102866

  • dweisser
  • dweissers Avatar
  • OFFLINE
  • Silver Donor
  • Beiträge: 182
  • Dank erhalten: 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
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
  • 2
Moderatoren: ITEd
Ladezeit der Seite: 0.148 Sekunden
Donation Image