Slide navbar from left using pure css











up vote
1
down vote

favorite












I am making angular application where i am using bootstrap 4 navbar without jquery or any third party plugin..



HTML:



<nav class="navbar navbar-expand-md bg-theme">
<div class="container-fluid">
<!-- Toggler/collapsibe Button -->
<button class="navbar-toggler" type="button" data-toggle="collapse" (click)="toggleNavigation()" data-target="#collapsibleNavbar">
<i class="fa fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav text-light">
<li class="nav-item">
<a routerLink="/dashboard" href="#">Dashboard</a>
</li>
<li class="nav-item">
<a routerLink="/template" href="#">Template</a>
</li>
<li class="nav-item">
<a routerLink="/product" href="#">Product</a>
</li>
</ul>
</div>
</div>
<!-- I have implemented the duplicate of above give navbar-nav for responsive.. Is there any need for this or can we do with the above code itself?? -->
<div *ngIf="showResponsivenavbar">
<ul class="navbar-nav text-light bg-custom-light p-3">
<li class="nav-item pb-2">
<a routerLink="/dashboard" href="#">Dashboard</a>
</li>
<li class="nav-item pb-2">
<a routerLink="/template" href="#">Template</a>
</li>
<li class="nav-item pb-2">
<a routerLink="/product" href="#">Product</a>
</li>
</ul>
</div>
</nav>


Css:



.bg-custom-light a {
color: #fff!important;
}
.bg-custom-light {
background-color: #e51631;
}

.navbar-nav {
position:fixed;
top:7%;
left:0;
width:150px;
-moz-transition:all 200ms ease-in;
-webkit-transition:all 200ms ease-in;
-o-transition:all 200ms ease-in;
transition:all 200ms ease-in;
}


I would like to make navbar toggle on responsive screen on click the icon bars which displays the navbar at bottom of icon bars.
The navbar gets displayed but i would like add the transition effect as it needs to slide in from left with certain duration, so i have given the following in css,



    -moz-transition:all 200ms ease-in;
-webkit-transition:all 200ms ease-in;
-o-transition:all 200ms ease-in;
transition:all 200ms ease-in;


But i couldn't see any animation effect in it. Kindly help me to achieve the slide in animation effect from left while clicking the toggle icon bar.. I also searched for the solutions around but couldn't get the right one and tried with transition css that too not helped me.



Working demo https://stackblitz.com/edit/angular-xmwnxt










share|improve this question


























    up vote
    1
    down vote

    favorite












    I am making angular application where i am using bootstrap 4 navbar without jquery or any third party plugin..



    HTML:



    <nav class="navbar navbar-expand-md bg-theme">
    <div class="container-fluid">
    <!-- Toggler/collapsibe Button -->
    <button class="navbar-toggler" type="button" data-toggle="collapse" (click)="toggleNavigation()" data-target="#collapsibleNavbar">
    <i class="fa fa-bars"></i>
    </button>
    <div class="collapse navbar-collapse" id="collapsibleNavbar">
    <ul class="navbar-nav text-light">
    <li class="nav-item">
    <a routerLink="/dashboard" href="#">Dashboard</a>
    </li>
    <li class="nav-item">
    <a routerLink="/template" href="#">Template</a>
    </li>
    <li class="nav-item">
    <a routerLink="/product" href="#">Product</a>
    </li>
    </ul>
    </div>
    </div>
    <!-- I have implemented the duplicate of above give navbar-nav for responsive.. Is there any need for this or can we do with the above code itself?? -->
    <div *ngIf="showResponsivenavbar">
    <ul class="navbar-nav text-light bg-custom-light p-3">
    <li class="nav-item pb-2">
    <a routerLink="/dashboard" href="#">Dashboard</a>
    </li>
    <li class="nav-item pb-2">
    <a routerLink="/template" href="#">Template</a>
    </li>
    <li class="nav-item pb-2">
    <a routerLink="/product" href="#">Product</a>
    </li>
    </ul>
    </div>
    </nav>


    Css:



    .bg-custom-light a {
    color: #fff!important;
    }
    .bg-custom-light {
    background-color: #e51631;
    }

    .navbar-nav {
    position:fixed;
    top:7%;
    left:0;
    width:150px;
    -moz-transition:all 200ms ease-in;
    -webkit-transition:all 200ms ease-in;
    -o-transition:all 200ms ease-in;
    transition:all 200ms ease-in;
    }


    I would like to make navbar toggle on responsive screen on click the icon bars which displays the navbar at bottom of icon bars.
    The navbar gets displayed but i would like add the transition effect as it needs to slide in from left with certain duration, so i have given the following in css,



        -moz-transition:all 200ms ease-in;
    -webkit-transition:all 200ms ease-in;
    -o-transition:all 200ms ease-in;
    transition:all 200ms ease-in;


    But i couldn't see any animation effect in it. Kindly help me to achieve the slide in animation effect from left while clicking the toggle icon bar.. I also searched for the solutions around but couldn't get the right one and tried with transition css that too not helped me.



    Working demo https://stackblitz.com/edit/angular-xmwnxt










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am making angular application where i am using bootstrap 4 navbar without jquery or any third party plugin..



      HTML:



      <nav class="navbar navbar-expand-md bg-theme">
      <div class="container-fluid">
      <!-- Toggler/collapsibe Button -->
      <button class="navbar-toggler" type="button" data-toggle="collapse" (click)="toggleNavigation()" data-target="#collapsibleNavbar">
      <i class="fa fa-bars"></i>
      </button>
      <div class="collapse navbar-collapse" id="collapsibleNavbar">
      <ul class="navbar-nav text-light">
      <li class="nav-item">
      <a routerLink="/dashboard" href="#">Dashboard</a>
      </li>
      <li class="nav-item">
      <a routerLink="/template" href="#">Template</a>
      </li>
      <li class="nav-item">
      <a routerLink="/product" href="#">Product</a>
      </li>
      </ul>
      </div>
      </div>
      <!-- I have implemented the duplicate of above give navbar-nav for responsive.. Is there any need for this or can we do with the above code itself?? -->
      <div *ngIf="showResponsivenavbar">
      <ul class="navbar-nav text-light bg-custom-light p-3">
      <li class="nav-item pb-2">
      <a routerLink="/dashboard" href="#">Dashboard</a>
      </li>
      <li class="nav-item pb-2">
      <a routerLink="/template" href="#">Template</a>
      </li>
      <li class="nav-item pb-2">
      <a routerLink="/product" href="#">Product</a>
      </li>
      </ul>
      </div>
      </nav>


      Css:



      .bg-custom-light a {
      color: #fff!important;
      }
      .bg-custom-light {
      background-color: #e51631;
      }

      .navbar-nav {
      position:fixed;
      top:7%;
      left:0;
      width:150px;
      -moz-transition:all 200ms ease-in;
      -webkit-transition:all 200ms ease-in;
      -o-transition:all 200ms ease-in;
      transition:all 200ms ease-in;
      }


      I would like to make navbar toggle on responsive screen on click the icon bars which displays the navbar at bottom of icon bars.
      The navbar gets displayed but i would like add the transition effect as it needs to slide in from left with certain duration, so i have given the following in css,



          -moz-transition:all 200ms ease-in;
      -webkit-transition:all 200ms ease-in;
      -o-transition:all 200ms ease-in;
      transition:all 200ms ease-in;


      But i couldn't see any animation effect in it. Kindly help me to achieve the slide in animation effect from left while clicking the toggle icon bar.. I also searched for the solutions around but couldn't get the right one and tried with transition css that too not helped me.



      Working demo https://stackblitz.com/edit/angular-xmwnxt










      share|improve this question













      I am making angular application where i am using bootstrap 4 navbar without jquery or any third party plugin..



      HTML:



      <nav class="navbar navbar-expand-md bg-theme">
      <div class="container-fluid">
      <!-- Toggler/collapsibe Button -->
      <button class="navbar-toggler" type="button" data-toggle="collapse" (click)="toggleNavigation()" data-target="#collapsibleNavbar">
      <i class="fa fa-bars"></i>
      </button>
      <div class="collapse navbar-collapse" id="collapsibleNavbar">
      <ul class="navbar-nav text-light">
      <li class="nav-item">
      <a routerLink="/dashboard" href="#">Dashboard</a>
      </li>
      <li class="nav-item">
      <a routerLink="/template" href="#">Template</a>
      </li>
      <li class="nav-item">
      <a routerLink="/product" href="#">Product</a>
      </li>
      </ul>
      </div>
      </div>
      <!-- I have implemented the duplicate of above give navbar-nav for responsive.. Is there any need for this or can we do with the above code itself?? -->
      <div *ngIf="showResponsivenavbar">
      <ul class="navbar-nav text-light bg-custom-light p-3">
      <li class="nav-item pb-2">
      <a routerLink="/dashboard" href="#">Dashboard</a>
      </li>
      <li class="nav-item pb-2">
      <a routerLink="/template" href="#">Template</a>
      </li>
      <li class="nav-item pb-2">
      <a routerLink="/product" href="#">Product</a>
      </li>
      </ul>
      </div>
      </nav>


      Css:



      .bg-custom-light a {
      color: #fff!important;
      }
      .bg-custom-light {
      background-color: #e51631;
      }

      .navbar-nav {
      position:fixed;
      top:7%;
      left:0;
      width:150px;
      -moz-transition:all 200ms ease-in;
      -webkit-transition:all 200ms ease-in;
      -o-transition:all 200ms ease-in;
      transition:all 200ms ease-in;
      }


      I would like to make navbar toggle on responsive screen on click the icon bars which displays the navbar at bottom of icon bars.
      The navbar gets displayed but i would like add the transition effect as it needs to slide in from left with certain duration, so i have given the following in css,



          -moz-transition:all 200ms ease-in;
      -webkit-transition:all 200ms ease-in;
      -o-transition:all 200ms ease-in;
      transition:all 200ms ease-in;


      But i couldn't see any animation effect in it. Kindly help me to achieve the slide in animation effect from left while clicking the toggle icon bar.. I also searched for the solutions around but couldn't get the right one and tried with transition css that too not helped me.



      Working demo https://stackblitz.com/edit/angular-xmwnxt







      html css angular twitter-bootstrap bootstrap-4






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 17 hours ago









      Mani Raj

      681927




      681927
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Transition needs to know both the before state, and the after state for it to work. Also, if the element is removed from the DOM with *ngIf, it won't exist for us to animate it.



          Instead, you can add a class to it that specifies whether it's open or not



           [ngClass]="{'open': showResponsivenavbar}"


          Then, change the CSS so that, be default, it's off the screen. When we add the open class, we can then move it on-screen, like so:



            .navbar-nav {
          position:fixed;
          top:7%;
          left: -150px;
          width:150px;
          -moz-transition:all 200ms ease-in;
          -webkit-transition:all 200ms ease-in;
          -o-transition:all 200ms ease-in;
          transition:all 200ms ease-in;
          }

          .open .navbar-nav {
          left: 0;
          }


          Now, when the open class is added, the menu will transition from being left: -150px to left: 0



          Here is a fork of your Stackblitz to show it working






          share|improve this answer





















          • For a better transition you could use transform instead of left. Because it then get's its own render layer. Setting left: 0; and transform: translateX( -200px ); as default
            – lumio
            17 hours ago












          • Thanks for your solution.. Can you clarify me another thing in the code i have posted?? I have duplicated the navbar-nav separately for responsive.. As because i am not using jquery i need to give custom function so using boolean, i am opening the showResponsivenavbar which is the duplicate of previous.. You could able to see this in code.. Is this is the only way or we can open the navbar with the same code without duplicating?? Just i am asking an extra suggestion in this question as you are expert in angular..
            – Mani Raj
            17 hours ago










          • @ManiRaj Im not sure what you mean, without duplicating what?
            – user184994
            16 hours ago










          • @user184994, You can see in my code ``` <ul class="navbar-nav text-light bg-custom-light p-3"> <li class="nav-item pb-2"> <a routerLink="/dashboard" href="#">Dashboard</a> </li> <li class="nav-item pb-2"> <a routerLink="/template" href="#">Template</a> </li> <li class="nav-item pb-2"> <a routerLink="/product" href="#">Product</a> </li> </ul> ```
            – Mani Raj
            16 hours ago










          • The above code was repeated two times.. Why because i am making duplication for responsive separately (which has that [ngClass]="{'open': showResponsivenavbar}".. The solution which you gave is also in that duplication only.. If you go through my code completly then you will get to know that duplication is required or in that first navbar itself we can do it??
            – Mani Raj
            16 hours ago













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237227%2fslide-navbar-from-left-using-pure-css%23new-answer', 'question_page');
          }
          );

          Post as a guest
































          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          Transition needs to know both the before state, and the after state for it to work. Also, if the element is removed from the DOM with *ngIf, it won't exist for us to animate it.



          Instead, you can add a class to it that specifies whether it's open or not



           [ngClass]="{'open': showResponsivenavbar}"


          Then, change the CSS so that, be default, it's off the screen. When we add the open class, we can then move it on-screen, like so:



            .navbar-nav {
          position:fixed;
          top:7%;
          left: -150px;
          width:150px;
          -moz-transition:all 200ms ease-in;
          -webkit-transition:all 200ms ease-in;
          -o-transition:all 200ms ease-in;
          transition:all 200ms ease-in;
          }

          .open .navbar-nav {
          left: 0;
          }


          Now, when the open class is added, the menu will transition from being left: -150px to left: 0



          Here is a fork of your Stackblitz to show it working






          share|improve this answer





















          • For a better transition you could use transform instead of left. Because it then get's its own render layer. Setting left: 0; and transform: translateX( -200px ); as default
            – lumio
            17 hours ago












          • Thanks for your solution.. Can you clarify me another thing in the code i have posted?? I have duplicated the navbar-nav separately for responsive.. As because i am not using jquery i need to give custom function so using boolean, i am opening the showResponsivenavbar which is the duplicate of previous.. You could able to see this in code.. Is this is the only way or we can open the navbar with the same code without duplicating?? Just i am asking an extra suggestion in this question as you are expert in angular..
            – Mani Raj
            17 hours ago










          • @ManiRaj Im not sure what you mean, without duplicating what?
            – user184994
            16 hours ago










          • @user184994, You can see in my code ``` <ul class="navbar-nav text-light bg-custom-light p-3"> <li class="nav-item pb-2"> <a routerLink="/dashboard" href="#">Dashboard</a> </li> <li class="nav-item pb-2"> <a routerLink="/template" href="#">Template</a> </li> <li class="nav-item pb-2"> <a routerLink="/product" href="#">Product</a> </li> </ul> ```
            – Mani Raj
            16 hours ago










          • The above code was repeated two times.. Why because i am making duplication for responsive separately (which has that [ngClass]="{'open': showResponsivenavbar}".. The solution which you gave is also in that duplication only.. If you go through my code completly then you will get to know that duplication is required or in that first navbar itself we can do it??
            – Mani Raj
            16 hours ago

















          up vote
          2
          down vote



          accepted










          Transition needs to know both the before state, and the after state for it to work. Also, if the element is removed from the DOM with *ngIf, it won't exist for us to animate it.



          Instead, you can add a class to it that specifies whether it's open or not



           [ngClass]="{'open': showResponsivenavbar}"


          Then, change the CSS so that, be default, it's off the screen. When we add the open class, we can then move it on-screen, like so:



            .navbar-nav {
          position:fixed;
          top:7%;
          left: -150px;
          width:150px;
          -moz-transition:all 200ms ease-in;
          -webkit-transition:all 200ms ease-in;
          -o-transition:all 200ms ease-in;
          transition:all 200ms ease-in;
          }

          .open .navbar-nav {
          left: 0;
          }


          Now, when the open class is added, the menu will transition from being left: -150px to left: 0



          Here is a fork of your Stackblitz to show it working






          share|improve this answer





















          • For a better transition you could use transform instead of left. Because it then get's its own render layer. Setting left: 0; and transform: translateX( -200px ); as default
            – lumio
            17 hours ago












          • Thanks for your solution.. Can you clarify me another thing in the code i have posted?? I have duplicated the navbar-nav separately for responsive.. As because i am not using jquery i need to give custom function so using boolean, i am opening the showResponsivenavbar which is the duplicate of previous.. You could able to see this in code.. Is this is the only way or we can open the navbar with the same code without duplicating?? Just i am asking an extra suggestion in this question as you are expert in angular..
            – Mani Raj
            17 hours ago










          • @ManiRaj Im not sure what you mean, without duplicating what?
            – user184994
            16 hours ago










          • @user184994, You can see in my code ``` <ul class="navbar-nav text-light bg-custom-light p-3"> <li class="nav-item pb-2"> <a routerLink="/dashboard" href="#">Dashboard</a> </li> <li class="nav-item pb-2"> <a routerLink="/template" href="#">Template</a> </li> <li class="nav-item pb-2"> <a routerLink="/product" href="#">Product</a> </li> </ul> ```
            – Mani Raj
            16 hours ago










          • The above code was repeated two times.. Why because i am making duplication for responsive separately (which has that [ngClass]="{'open': showResponsivenavbar}".. The solution which you gave is also in that duplication only.. If you go through my code completly then you will get to know that duplication is required or in that first navbar itself we can do it??
            – Mani Raj
            16 hours ago















          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          Transition needs to know both the before state, and the after state for it to work. Also, if the element is removed from the DOM with *ngIf, it won't exist for us to animate it.



          Instead, you can add a class to it that specifies whether it's open or not



           [ngClass]="{'open': showResponsivenavbar}"


          Then, change the CSS so that, be default, it's off the screen. When we add the open class, we can then move it on-screen, like so:



            .navbar-nav {
          position:fixed;
          top:7%;
          left: -150px;
          width:150px;
          -moz-transition:all 200ms ease-in;
          -webkit-transition:all 200ms ease-in;
          -o-transition:all 200ms ease-in;
          transition:all 200ms ease-in;
          }

          .open .navbar-nav {
          left: 0;
          }


          Now, when the open class is added, the menu will transition from being left: -150px to left: 0



          Here is a fork of your Stackblitz to show it working






          share|improve this answer












          Transition needs to know both the before state, and the after state for it to work. Also, if the element is removed from the DOM with *ngIf, it won't exist for us to animate it.



          Instead, you can add a class to it that specifies whether it's open or not



           [ngClass]="{'open': showResponsivenavbar}"


          Then, change the CSS so that, be default, it's off the screen. When we add the open class, we can then move it on-screen, like so:



            .navbar-nav {
          position:fixed;
          top:7%;
          left: -150px;
          width:150px;
          -moz-transition:all 200ms ease-in;
          -webkit-transition:all 200ms ease-in;
          -o-transition:all 200ms ease-in;
          transition:all 200ms ease-in;
          }

          .open .navbar-nav {
          left: 0;
          }


          Now, when the open class is added, the menu will transition from being left: -150px to left: 0



          Here is a fork of your Stackblitz to show it working







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 17 hours ago









          user184994

          10.4k11426




          10.4k11426












          • For a better transition you could use transform instead of left. Because it then get's its own render layer. Setting left: 0; and transform: translateX( -200px ); as default
            – lumio
            17 hours ago












          • Thanks for your solution.. Can you clarify me another thing in the code i have posted?? I have duplicated the navbar-nav separately for responsive.. As because i am not using jquery i need to give custom function so using boolean, i am opening the showResponsivenavbar which is the duplicate of previous.. You could able to see this in code.. Is this is the only way or we can open the navbar with the same code without duplicating?? Just i am asking an extra suggestion in this question as you are expert in angular..
            – Mani Raj
            17 hours ago










          • @ManiRaj Im not sure what you mean, without duplicating what?
            – user184994
            16 hours ago










          • @user184994, You can see in my code ``` <ul class="navbar-nav text-light bg-custom-light p-3"> <li class="nav-item pb-2"> <a routerLink="/dashboard" href="#">Dashboard</a> </li> <li class="nav-item pb-2"> <a routerLink="/template" href="#">Template</a> </li> <li class="nav-item pb-2"> <a routerLink="/product" href="#">Product</a> </li> </ul> ```
            – Mani Raj
            16 hours ago










          • The above code was repeated two times.. Why because i am making duplication for responsive separately (which has that [ngClass]="{'open': showResponsivenavbar}".. The solution which you gave is also in that duplication only.. If you go through my code completly then you will get to know that duplication is required or in that first navbar itself we can do it??
            – Mani Raj
            16 hours ago




















          • For a better transition you could use transform instead of left. Because it then get's its own render layer. Setting left: 0; and transform: translateX( -200px ); as default
            – lumio
            17 hours ago












          • Thanks for your solution.. Can you clarify me another thing in the code i have posted?? I have duplicated the navbar-nav separately for responsive.. As because i am not using jquery i need to give custom function so using boolean, i am opening the showResponsivenavbar which is the duplicate of previous.. You could able to see this in code.. Is this is the only way or we can open the navbar with the same code without duplicating?? Just i am asking an extra suggestion in this question as you are expert in angular..
            – Mani Raj
            17 hours ago










          • @ManiRaj Im not sure what you mean, without duplicating what?
            – user184994
            16 hours ago










          • @user184994, You can see in my code ``` <ul class="navbar-nav text-light bg-custom-light p-3"> <li class="nav-item pb-2"> <a routerLink="/dashboard" href="#">Dashboard</a> </li> <li class="nav-item pb-2"> <a routerLink="/template" href="#">Template</a> </li> <li class="nav-item pb-2"> <a routerLink="/product" href="#">Product</a> </li> </ul> ```
            – Mani Raj
            16 hours ago










          • The above code was repeated two times.. Why because i am making duplication for responsive separately (which has that [ngClass]="{'open': showResponsivenavbar}".. The solution which you gave is also in that duplication only.. If you go through my code completly then you will get to know that duplication is required or in that first navbar itself we can do it??
            – Mani Raj
            16 hours ago


















          For a better transition you could use transform instead of left. Because it then get's its own render layer. Setting left: 0; and transform: translateX( -200px ); as default
          – lumio
          17 hours ago






          For a better transition you could use transform instead of left. Because it then get's its own render layer. Setting left: 0; and transform: translateX( -200px ); as default
          – lumio
          17 hours ago














          Thanks for your solution.. Can you clarify me another thing in the code i have posted?? I have duplicated the navbar-nav separately for responsive.. As because i am not using jquery i need to give custom function so using boolean, i am opening the showResponsivenavbar which is the duplicate of previous.. You could able to see this in code.. Is this is the only way or we can open the navbar with the same code without duplicating?? Just i am asking an extra suggestion in this question as you are expert in angular..
          – Mani Raj
          17 hours ago




          Thanks for your solution.. Can you clarify me another thing in the code i have posted?? I have duplicated the navbar-nav separately for responsive.. As because i am not using jquery i need to give custom function so using boolean, i am opening the showResponsivenavbar which is the duplicate of previous.. You could able to see this in code.. Is this is the only way or we can open the navbar with the same code without duplicating?? Just i am asking an extra suggestion in this question as you are expert in angular..
          – Mani Raj
          17 hours ago












          @ManiRaj Im not sure what you mean, without duplicating what?
          – user184994
          16 hours ago




          @ManiRaj Im not sure what you mean, without duplicating what?
          – user184994
          16 hours ago












          @user184994, You can see in my code ``` <ul class="navbar-nav text-light bg-custom-light p-3"> <li class="nav-item pb-2"> <a routerLink="/dashboard" href="#">Dashboard</a> </li> <li class="nav-item pb-2"> <a routerLink="/template" href="#">Template</a> </li> <li class="nav-item pb-2"> <a routerLink="/product" href="#">Product</a> </li> </ul> ```
          – Mani Raj
          16 hours ago




          @user184994, You can see in my code ``` <ul class="navbar-nav text-light bg-custom-light p-3"> <li class="nav-item pb-2"> <a routerLink="/dashboard" href="#">Dashboard</a> </li> <li class="nav-item pb-2"> <a routerLink="/template" href="#">Template</a> </li> <li class="nav-item pb-2"> <a routerLink="/product" href="#">Product</a> </li> </ul> ```
          – Mani Raj
          16 hours ago












          The above code was repeated two times.. Why because i am making duplication for responsive separately (which has that [ngClass]="{'open': showResponsivenavbar}".. The solution which you gave is also in that duplication only.. If you go through my code completly then you will get to know that duplication is required or in that first navbar itself we can do it??
          – Mani Raj
          16 hours ago






          The above code was repeated two times.. Why because i am making duplication for responsive separately (which has that [ngClass]="{'open': showResponsivenavbar}".. The solution which you gave is also in that duplication only.. If you go through my code completly then you will get to know that duplication is required or in that first navbar itself we can do it??
          – Mani Raj
          16 hours ago




















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237227%2fslide-navbar-from-left-using-pure-css%23new-answer', 'question_page');
          }
          );

          Post as a guest




















































































          Popular posts from this blog

          Full-time equivalent

          Bicuculline

          さくらももこ