Community Groups are officially here!
We've released Groups, a new feature that enables us to connect community members of similar industries and interests in a shared, private space. You can check out all of the details here, including information about who can join, how to join, and what Groups are currently offered. Please leave your feedback through this Community Groups Feedback Survey.

Block Specific CSS?

red5
red5 UtahCommunity Member Qubie ✭

I want to include css in my external stylesheet that is specific to certain blocks. Is it possible to target blocks? I have a custom button in my footer that I'd like to hide sometimes. It's related to this post:
https://www.qualtrics.com/community/discussion/2080/javascript-button-that-jumps-to-the-last-block-not-the-survey-end#latest

Tagged:

Best Answers

  • MohammedAli_Rajapkar
    MohammedAli_Rajapkar Mumbai - IndiaCommunity Member, Qualtrics Brand Admin Wizard ✭✭✭✭✭
    Accepted Answer

    You can try adding below code in the header section of "Look&Feel", change the "BlockID" with the specific BlockID in which you want to hide the button, and change ButtonID with the actual button ID which you want to hide.

    Qualtrics.SurveyEngine.addOnload(function() {
    if (jQuery("a[id='BlockID']").length > 0)
    {
    jQuery("#ButtonID").hide();
    }
    });

  • red5
    red5 UtahCommunity Member Qubie ✭
    Accepted Answer

    @Mohammedali_Rajapakar_Ugam
    Thank you. That works.
    In my case, I want to hide my button from any blocks that aren't part of the Table of Contents. Your jQuery link with the BlockID will always be true when the Table of Contents is available, so this also works:

        Qualtrics.SurveyEngine.addOnload(function() {
        if (jQuery("a[id='BlockID']").length > 0) //where BlockID == any block in the TOC
        {
         jQuery('#ButtonID').css("display","block") //by default my CSS hides the button. This will show it on TOC pages
        }
        });