For this to function I need to click twice on my toggle link. And cannot really see why nor get solution to make it work on the first click. Can somepone explain why like this and what to do? The idea is to show hide a navigation bar (fixed) here is JS
<script>
function toggle_visibility(id) {
var e = document.getElementById(id);
e.style.display = ((e.style.display!='none') ? 'none' : 'block');
}
</script>
And the Html
<div class="nav">
<a onclick="toggle_visibility('navbar');" style="cursor:pointer;">V</a>
<div id="navbar" class="hidden">navigation items</div>
</div>
And some CSS
.hidden {display:none;}
Reason of the .hidden class is to have it hidden in the beggining. i didnt get done othe way. It should be possible though i think. :) thanks in advance