cosmichero2025
cosmichero2025

Reputation: 1029

Sidebar navigation not showing up

I'm using the w3 schools sidebar navigation and I've been trying to get a side-nav that opens from one div. exp: http://www.w3schools.com/w3css/tryit.aspfilename=tryw3css_sidenav_left_right&stacked=h (Only the right one though)

Later on I'd like to make this nav sit at the bottom and open upwards. To the problem at hand though. I can't get this sidebar to show above the already existing page. The page consists of a randomly selected flash file. I have a feeling that one of the already existing position attributes is affecting this one or maybe one of the styles that I haven't been able to find.

HTML

<nav class="w3-sidenav w3-white w3-card-2 w3-animate-right" style="display:none;right:0;" id="rightMenu">
  <a href="javascript:void(0)" onclick="closeRightMenu()"
  class="w3-closenav w3-large">Close &times;</a>
 <a href="#"><i class="fa fa-home w3-xxlarge"></i></a> 
  <a href="#"><i class="fa fa-search w3-xxlarge"></i></a> 
  <a href="#"><i class="fa fa-envelope w3-xxlarge"></i></a> 
  <a href="#"><i class="fa fa-globe w3-xxlarge"></i></a> 
</nav>


    <object id="flash-container">
        <embed id="flash-content" src="" type="application/x-shockwave-flash" /> 
</object>

CSS

html,
body {
    margin: 0px;
    padding: 0px;
    border: 0px;
    width: 100%;
    height: 100%;
    background-color: #2e1565;
}

#popup-container {
    display: inline-block;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
}

#flash-container {
    z-index: 0;
    position: absolute;
    min-width: 100%;
    min-height: 100%;
    width: 100% !important;
    height: auto !important;
}

#flash-content {
    position: absolute;
    min-width: 100%;
    min-height: 100%;
    width: 100% !important;
    height: auto !important;
    overflow: hidden;
    z-index: 1;
    background-color: #2e1565;
}

#flash_name {
    color: #5c5ce0;
    z-index: 20;
    position: absolute;
    padding-left: 50%;
}

#rightMenu {
    position: relative;
    z-index: 3;
}

JS

function openRightMenu() {
            document.getElementById("rightMenu").style.display = "block";
        }

        function closeRightMenu() {
            document.getElementById("rightMenu").style.display = "none";
        }

Upvotes: 0

Views: 763

Answers (1)

elvislives
elvislives

Reputation: 138

Remove the display:none from the style attribute of the nav tag and it will show.

Here it is with the display:none removed on jsbin: http://jsbin.com/nubewuragu/edit?html,css,js,output

Upvotes: 1

Related Questions