Different Background for Different Blocks | XM Community
Skip to main content
Hello everyone,



I know how to set a background for the entire survey but does anyone know how I could set different backgrounds for different blocks?
Hello @benched ,



We can paste following code in the js(OnReady) of the each question and change background URL attribute based on the question present in which block



Add the following code in the each question of block Or if you have multiple question on one page then paste the following code on only one question in js(onReady)



jQuery("#SurveyEngineBody").css({"background":"url('YOUR_IMAGE_URL')",

"background-size": "cover",

"background-repeat": "no-repeat",

" background-position": "center center"});



jQuery(".Skin #SkinContent").css({

"background":"white"

});



jQuery(".Skin .SkinInner").css("cssText","background : transparent !important");
Any way to adjust the transparency? I appreciate your help.
@Shashi, I used your code, and it works great! But I ran into a problem -- when I force responses, and a respondent skips a question, the error message appears, and the background color is gone. How do I fix it so that the background color stays when the error message appears? Thank you in advance.
> @benched said:

> Any way to adjust the transparency? I appreciate your help.



Hi,

Did you finally find a way to adjust transparency ? I have the same problem...

We have a survey with 3 sections and we want to use a background image for the 2nd section while keeping the other 2 blank
I used this code but I believe that using this code in the first block of the survey makes it applicable for the entire survey and the whole survey became blank
Please let me know if you have a workaround


Leave a Reply