2012-09-19, 06:55 PM
I'm currently working on coding a theme, but I've come across a little problem. I have a Sign Up button that isn't located in the header_welcomeblock_guest template, but I only want to show it when the user is logged out. So I added this code into the header_welcomeblock_guest template to only hide it when the user is logged out:
I know the code is sloppy but I was just testing. Anyways, here's the element:
I also have the element set to display: none; by default. However, it just won't show up, logged in or not. Any idea why? Hopefully I didn't just spell something wrong. xD
<script type="text/javascript">
if(document.getElementById('sign_up').style.display == "block"){
document.getElementById('sign_up').style.display = "none";
}else{
document.getElementById('sign_up').style.display = "block";
}
</script>
I know the code is sloppy but I was just testing. Anyways, here's the element:
<div class="sign_up" id="sign_up">
<a href="#">Sign Up! <i class="icon-cloud"></i></a>
</div>
I also have the element set to display: none; by default. However, it just won't show up, logged in or not. Any idea why? Hopefully I didn't just spell something wrong. xD