Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9253161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:08:53+00:00 2026-06-18T11:08:53+00:00

I am trying to make an off-canvas navigation that slides in from the left

  • 0

I am trying to make an off-canvas navigation that slides in from the left to take up 20% of the page while the content slides to the left ( some of it will be off canvas ) taking up 80% of the page.
This has been seen in Google’s mobile site and Facebook’s mobile app.

Here is a version using CSS3 Transitions: http://codepen.io/chriscoyier/pen/umEgv

Except, I am trying to make one that relies only on JQuery / Javascript and not CSS Transitions at all.

Below is a link to what I have so far.

I don’t understand why it is not working. The width of the #main-nav should be toggled every time .menu-button is clicked; thus creating a sliding tot he right effect.

Can someone please help me fix this and / or help me with that I am trying to achieve.

Here is what I have so far: http://pastebin.com/0X7uT7tC

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:08:54+00:00Added an answer on June 18, 2026 at 11:08 am

    Changed width to 20% in css and then hide this on load.

    HERE IS FIDDLE

    jQuery

     $('#main-nav').hide();
     $('.menu-button').click(function () {
         $('#main-nav').animate({
             width: 'toggle'
         });
     });
    

    CSS

        .main-nav {
        position: fixed;
        top: 0;
        width: 20%;
        height: 100%;
        background: #3B3B3B;
        overflow: hidden;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a site with an off-canvas navigation that slides in
I've been trying to make a for loop that will iterate based off of
I'm trying to make a Windows Phone 7 app that will save some images
I'm trying to make a selector that will show options based off of what
I am trying to make an accordion image gallery that works based off an
I'm trying to make a log-in log-off with Ajax supported. I made some logic
Im trying to make dynamic column list that will be 4 columns total (PHP).
I'm trying to make a simple JQuery button from a div which will change
I'm trying to make an app that will respond to your command when inserted.
I am trying to make an application to take photos off of a website,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.