- Posts: 15
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Removing the White Question Container
- MW1234
- Topic Author
- Offline
- New Member
Less
More
5 years 4 months ago #178473
by MW1234
Removing the White Question Container was created by MW1234
Hey everyone!
Last time I asked for someone to help me, they required a live test survey, and I messed up by keeping a timer on the questions which made helping me impossible.
So here's the last summary of my (hopefully) last question for my survey ^^
I managed to randomise the background colour and change the text colour accordingly. The problem I'm facing now is that I'm using white as a text colour.
This means that within the Question+Answers Container the writing is invisible since those containers are white as well.
I found some white colours under <style> that would probably fit the white I want to change, but I realised I, first of all, don't know HOW to change it and if I changed it what colour I'd change it to since it should be the same as the background colour.
How do I remove the colouring of the question+answers container so that the question and choosable answers are on the same background as p.e. the Question Group Name? Or can I somehow incorporate the Question+Answer Container into the code so that it changes based on the same Random Number that defines the background colour?
For reference, here is the entire code I'm currently using:
The live survey is on this website
You can use incognito mode or delete cookies if you want to do it more than once.
Thank you so much up ahead, if this works it will become a massive part of my scientific paper on Colour Psychology!
Last time I asked for someone to help me, they required a live test survey, and I messed up by keeping a timer on the questions which made helping me impossible.
So here's the last summary of my (hopefully) last question for my survey ^^
I managed to randomise the background colour and change the text colour accordingly. The problem I'm facing now is that I'm using white as a text colour.
This means that within the Question+Answers Container the writing is invisible since those containers are white as well.
I found some white colours under <style> that would probably fit the white I want to change, but I realised I, first of all, don't know HOW to change it and if I changed it what colour I'd change it to since it should be the same as the background colour.
How do I remove the colouring of the question+answers container so that the question and choosable answers are on the same background as p.e. the Question Group Name? Or can I somehow incorporate the Question+Answer Container into the code so that it changes based on the same Random Number that defines the background colour?
For reference, here is the entire code I'm currently using:
Code:
{if(is_empty(Q1), rand(0, 99), Q1)} <script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ var num = "{Q1}"; if(num.indexOf('<span') >= 0) { num = num.split('>')[1].split('<')[0]; } document.body.style.color = "white"; var bodyColor; if (num < 40) { bodyColor = 'darkred'; } else if (num < 80) { bodyColor = 'darkblue'; } else { bodyColor = 'darkgreen'; } $('body').css({ 'background-color': bodyColor }); }); </script>
The live survey is on this website
You can use incognito mode or delete cookies if you want to do it more than once.
Thank you so much up ahead, if this works it will become a massive part of my scientific paper on Colour Psychology!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13643
- Thank you received: 2491
5 years 4 months ago #178475
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Removing the White Question Container
Quicly:
.question-container{background:inherit;color:inherit}
in custom.css
.question-container{background:inherit;color:inherit}
in custom.css
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- MW1234
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 0
5 years 4 months ago #178478
by MW1234
Replied by MW1234 on topic Removing the White Question Container
Wow, thanks for the quick reply!
What happened when I applied this to the custom.css for the fruity_extended theme is that the randomised background colour only stays for the one equation question, but all of the following questions have the standard fruity white with black text.
This happens both when the equation question is in the same question group as the other questions and when it's in a separate group.
What happened when I applied this to the custom.css for the fruity_extended theme is that the randomised background colour only stays for the one equation question, but all of the following questions have the standard fruity white with black text.
This happens both when the equation question is in the same question group as the other questions and when it's in a separate group.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13643
- Thank you received: 2491
5 years 4 months ago #178481
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Removing the White Question Container
Since fuity are white by default : no need to update.
Else in your script : $('body').addClass('coloredBody')
And in css
.coloredBody .question-container{background:inherit;color:inherit}
Else in your script : $('body').addClass('coloredBody')
And in css
.coloredBody .question-container{background:inherit;color:inherit}
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- MW1234
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 0
5 years 4 months ago #178485
by MW1234
Replied by MW1234 on topic Removing the White Question Container
I can't get it to work
If you could get it to work in an lss file or send a screenshot of how it looks in the code I'd really appreciate it.
This is my lss:
If you could get it to work in an lss file or send a screenshot of how it looks in the code I'd really appreciate it.
This is my lss:
Attachments:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13643
- Thank you received: 2491
5 years 4 months ago #178487
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Removing the White Question Container
I just test with developper tool …
I don't have time to make it personnaly …
I don't have time to make it personnaly …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- MW1234
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 0
5 years 4 months ago #178488
by MW1234
Replied by MW1234 on topic Removing the White Question Container
That's fine, thanks anyway! I can't figure out where to throw the code in and where to put the CSS. My knowledge around programming is minimal.
The topic has been locked.
- MW1234
- Topic Author
- Offline
- New Member
Less
More
- Posts: 15
- Thank you received: 0
5 years 3 months ago #178755
by MW1234
Replied by MW1234 on topic Removing the White Question Container
Push ^^
The topic has been locked.