Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6983139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:22:46+00:00 2026-05-27T18:22:46+00:00

I am working with Vanilla and want to hide a div if the user

  • 0

I am working with Vanilla and want to hide a div if the user is signed in.

One of the coders gave me this code.

<script language="javascript">
 jQuery(document).ready(function($) {
 if (gdn.definition('SignedIn', '0') != '0') {
 <div class="sp-container">
   <p>blah blah blah</p>
 </div>
 }
 });
 </script>

The div class sp-container I want to hide IF user is signed in.

One of the members suggested, using

    $('.sp-container').hide();

or

    $('.sp-container').css({'visibility':'hidden'});

But I am not sure how to actually do that code. Or where and how to add it… any help please.

All I wish to do is, NOT display the div sp-container IF user is signed in.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:22:47+00:00Added an answer on May 27, 2026 at 6:22 pm

    Not sure if this will work as dont know vanilla – but this will work if the property is set :

    <script type="text/javascript">
     jQuery(document).ready(function() {
        if (gdn.definition('SignedIn', '0') != '0') {
           jQuery(".sp-container").hide();
        }
     });
     </script>
    

    This will run after the DOM is ready (the ready() function) and will check the gdn.definition – if its not ‘0’ it will hide the div with the class “sp-container” – remember to include the jQuery library

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to do a little animation on this latest website ii'm working on.
I have a simple shell script which looks like this: R --vanilla<myMRjob.R hadoop fs
Working on a small game using an HTML5 canvas, and javascript. And it's working
Working with H2 I get this error when I try to write a row
I am working on a bit of javascript to plot data on a <canvas
I'm using plain vanilla JavaScript to clone fieldsets and change the ID/name attributes of
Working sample using one Table SELECT t.* FROM ( SELECT TITLE.name, (TITLE.value-TITLE.msp) AS Lower,
Dear experts, I am currently working on an code that allows users to drag
I'm coding a JavaScript client to a REST JSON API. Since I don't want
Working on this EF tutorial , I've difficult to understand the meaning of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.