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.
Not sure if this will work as dont know vanilla – but this will work if the property is set :
This will run after the DOM is ready (the
ready()function) and will check thegdn.definition– if its not ‘0’ it will hide the div with the class “sp-container” – remember to include the jQuery library