Skip to main content
Known Participant
November 23, 2018
Question

Slide in and out navigation

  • November 23, 2018
  • 1 reply
  • 1060 views

Good evening. Is it possible to do a slide in and out nav bar that resides on the top? I want to have this feature work where my photography content will sit, where the bar moves out of site, when the viewer views the work.

[Moderator edit: the related site is MICHAEL GUYDON PHOTOGRAPHY​]

    This topic has been closed for replies.

    1 reply

    BenPleysier
    Community Expert
    Community Expert
    November 23, 2018
    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    Legacys7Author
    Known Participant
    November 23, 2018

    Yes. But the nav bar at the top achieving the same function. Is that possible?

    Legend
    November 23, 2018

    Yes.

    At the beginning of your page you have an empty 'container' div which is serving no purpose so use it to insert an icon to open the top menu. I've just used some text and given the div a new class of 'show-nav': (you can use a font-awesome icon or the Bootstrap hamburger icon)

    <div class="show-nav">MENU</div>

    Add these css selectors to your css styles:

    .show-nav {

    text-align: right;

    padding: 20px 60px;

    }

    .navbar {

    transform: translateX(100%);

    transition: all 600ms ease;

    }

    .slide_nav {

    transform: translateX(0);

    }

    Then add the jQuery below AFTER the link to:

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->

      <script src="http://michaelguydonphotography.com/js/jquery-3.2.1.min.js"></script>

    <script>

    $(document).ready(function(){

    $('.show-nav').css('cursor' , 'pointer').click(function(){

    $('.navbar').addClass('slide_nav');

    });

    });

    </script>