Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Hide div / element if user signed in
422
MVP
Ok this is a html request but need some help please.
I have a div, and wish to hide that div if user is signed in.
@Todd did some code earlier, but not sure how to accomplish what I want. I suppose I would or could display:none but... anyhoo..
< script language="javascript">
jQuery(document).ready(function($) {
if (gdn.definition('SignedIn', '0') != '0') {
< div class="sp-container">
< /div>
}
});
< /script>
I wish to hide content of sp-container if user not logged in. Tried using Todds code but I am pretty crap with js etc.
There was an error rendering this rich post.
1
Answers
Have ur div in page and in script in { } try something like
$('.sp-container').css('display' , 'none');
Or $('.sp-container').html(' '); to clear all content of div
There was an error rendering this rich post.
or
If you want to keep the space.
grep is your friend.
Brilliant thanks guys, I opted for .hide method. Thanks a million
There was an error rendering this rich post.