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

Hiding Header on Landing Page

  • Oct 17, 2018 11:54 PM UTC
  • 5 replies
  • 508 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(); }); ```
View original

5 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • Oct 18, 2018 1:24 AM UTC
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
  • Oct 18, 2018 1:50 PM UTC
@TomG Perfect! Thanks!

Akdashboard
Level 4 ●●●●
Forum|alt.badge.img+6
  • Level 4 ●●●●
  • Feb 19, 2020 2:58 PM UTC
> @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 ●●●●●●●●
  • Feb 19, 2020 3:00 PM UTC
Try switching addOnload to addOnReady.

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