Hiding Header on Landing Page | XM Community
Solved

Hiding Header on Landing Page

  • 18 October 2018
  • 5 replies
  • 153 views

Hi,

I'd like to hide the header on the landing page of the survey (QID2) using the custom CSS. I've drafted the code below but it doesn't work. Any suggestions? Thanks!

Qualtrics.SurveyEngine.addOnload(function () {
if(jQuery('#QID2').length > 0)
{
jQuery("#Header").hide();
}
});
icon

Best answer by TomG 18 October 2018, 03:24

View original

5 replies

Userlevel 7
Badge +27
That's JavaScript, not CSS. You should just add the JavaScript to the first question (QID2) as:
```
Qualtrics.SurveyEngine.addOnload(function () {
jQuery("#Header").hide();
});
```
@TomG Perfect! Thanks!
Userlevel 7
Badge +6
> @TomG said:
> That's JavaScript, not CSS. You should just add the JavaScript to the first question (QID2) as:
> ```
> Qualtrics.SurveyEngine.addOnload(function () {
> jQuery("#Header").hide();
> });
> ```

Is this known to have any issues with the Table of Content element? This seems to work when I view the block alone, but when I preview the whoel survey and get to this question, it does not. The survey is pretty vanilla except that it uses a Table of Contents element, which is what I am guessing is causing the problem. Has anyone else experienced this?
Userlevel 7
Badge +27
Try switching addOnload to addOnReady.
Userlevel 7
Badge +6
Putting in OnReady fixed the problem. Thanks @TomG

Leave a Reply