Hiding Header on Landing Page | XM Community
Skip to main content
Solved

Hiding Header on Landing Page

  • October 17, 2018
  • 5 replies
  • 403 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(); } });

Best answer by TomG

That's JavaScript, not CSS. You should just add the JavaScript to the first question (QID2) as: ``` Qualtrics.SurveyEngine.addOnload(function () { jQuery("#Header").hide(); }); ```

5 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • October 18, 2018
That's JavaScript, not CSS. You should just add the JavaScript to the first question (QID2) as: ``` Qualtrics.SurveyEngine.addOnload(function () { jQuery("#Header").hide(); }); ```

  • Author
  • October 18, 2018
@TomG Perfect! Thanks!

Akdashboard
Level 4 ●●●●
Forum|alt.badge.img+6
  • Level 4 ●●●●
  • February 19, 2020
> @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?

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • February 19, 2020
Try switching addOnload to addOnReady.

Akdashboard
Level 4 ●●●●
Forum|alt.badge.img+6
  • Level 4 ●●●●
  • February 21, 2020
Putting in OnReady fixed the problem. Thanks @TomG