Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
10
rated 0 times [  14] [ 4]  / answers: 1 / hits: 7311  / 11 Years ago, mon, december 30, 2013, 12:00:00

I already read the related questions, which unfortunately do not give an answer to my specific problem:



On the basis of Bootstrap 3.0.3, I am trying to create a fixed navbar on the left with a width of 50px, which should expand to a width of 150px, when you click on the navbar-toogle. When the navbar is not expanded, it should display only the glyphicons for each link. I am able to create the navbar with a fixed width, but I am stuck with the correct incorporation of the navbar-toggle and the the span-text, which is neither displaying nor working correctly. Have a look at the example pictures for the intended result:



Sidebar



Sidebar



HTML:



<!-- Sidebar -->
<div id=sidebar role=navigation>
<button type=button class=navbar-toggle data-toggle=collapse data-target=.navbar-collapse>
<span class=sr-only>Toggle navigation</span>
<span class=icon-bar></span>
<span class=icon-bar></span>
<span class=icon-bar></span>
</button>


<div id=sidebar-nav>
<ul class=nav nav-stacked>

<li><a href=http://stackoverflow.com/> <span class=glyphicon glyphicon-star></span>Link1</a></li>
<li><a href=http://stackoverflow.com/> <span class=glyphicon glyphicon-cloud></span>Link2</a></li>
<li><a href=http://stackoverflow.com/> <span class=glyphicon glyphicon-fire></span>Link3</a></li>
<li><a href=http://stackoverflow.com/> <span class=glyphicon glyphicon-heart></span>Link4</a></li>
<li><a href=http://stackoverflow.com/> <span class=glyphicon glyphicon-send></span>Link5</a></li>

</ul>
</div>
<!-- Sidebar End -->
</div>


CSS:



    #sidebar {
background-color: #16a085;
color: white;
height: 100%;
padding: 0;
position: fixed;
left: 0;
top: 0;
width: 50px;
z-index: 2;

}

#sidebar-nav {
margin-top: 75px;
}


I would appreciate your advice on this.


More From » html

 Answers
0

Something like this sort of what you're after? Animations can be done with -webkit-transition on the width. I'll fine tune this when I get the time in half an hour.



#sidebar .link-text {
visibility: hidden;
}
#sidebar:hover .link-text {
visibility: visible;
}

[#49130] Sunday, December 29, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dusty

Total Points: 739
Total Questions: 97
Total Answers: 85

Location: Angola
Member since Wed, Apr 13, 2022
2 Years ago
;