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:
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!