[Support request] hide div for javascript deactivated browsers.

Home Forums Support [Support request] hide div for javascript deactivated browsers.

Home Forums Support hide div for javascript deactivated browsers.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2150753
    Patricia

    Hi guys can you please help?

    I would like to ask how do I proceed to hide the main content div to browsers that are not using javascript and replace the content with a message saying that this site needs javascript to continue the access (in the main content area div).

    Many many thanks for that!

    #2150785
    David
    Staff
    Customer Support

    Hi there,

    I am really not sure about this, but if need be you can use a Hook Element, to add some <noscript> HTML and styles to the page:

    <noscript>
    <style>
        #main {
            display: none !important;
        }
    </style>
    <div>Your no Javascript message here</div>
    </noscript>

    Use the generate_before_main_content hook

    #2151022
    Patricia

    thank you! I will try this and will let you know! Have a great weekend!

    #2151031
    David
    Staff
    Customer Support

    You’re welcome and you too

    #2151045
    Patricia

    Hello David!

    This works but I cannot show the warning message. any thoughts? thank you!

    #2151051
    David
    Staff
    Customer Support

    Where can I see this ?

    #2151052
    Patricia

    I put my message where you indicated

    </style>

    Your no Javascript message here

    </noscript>

    But i can just see the blank div without the prase. do you know what I mean? πŸ™‚ thank u!

    #2151071
    David
    Staff
    Customer Support

    Sorry I meant a link to a page on the website you added it to

    #2151072
    Patricia

    ah ok! I am sending in the private tab πŸ™‚ Merci!

    #2151078
    David
    Staff
    Customer Support

    Oh my – what was I thinking lol.
    Change the Hook to generate_after_header

    The other hook is inside the element that the script is hiding… so it hides itself πŸ™‚

    #2151081
    Patricia

    hahaha no problems!! It is working perfectly now! Thank you!

    Have a great weekend!

    Patricia.

    #2151084
    David
    Staff
    Customer Support

    Glad to hear that!!

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.