Mobile navigation menu options on the left and right sides

I've encountered an issue with my mobile navigation. I have two navigation menus - one on the left and one on the right, designed to slide out when triggered. The left menu functions correctly with a smooth transition, but the right menu abruptly pops open without any animation.

I've spent the past 4 hours dissecting the CSS code, attempting various transitions to rectify the problem. Despite other components working as intended, I can't seem to achieve the desired smooth slide-out effect on the right menu.

For reference, here's a jsFiddle containing some of the pertinent code: http://jsfiddle.net/Etn6q/

Initially, I followed this tutorial for implementing off-canvas navigation menus:

<div id="outer-wrap">
    <div id="inner-wrap">

        <div id="top_mobile_bar" class="clearfix">
            <a class="nav-btn" id="nav-open-btn" href="#nav">Menu</a>
            <a class="nav-btn" id="info-open-btn" href="#info">Info</a>
        </div>

Additionally, I've incorporated styles from style.css and made modifications in mobile-flyout-menu.css to include all the necessary transitions:

.csstransforms3d.csstransitions.js-ready #info .block {
    filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
    opacity: 1;
    transition: all 0.2s ease 0s;

    -webkit-transition:         opacity 300ms 100ms, -webkit-transform 500ms ease;
    -webkit-transition-delay:   ease, 0s;
    -moz-transition:            opacity 300ms 100ms ease, -moz-transform 500ms ease;
    -o-transition:              opacity 300ms 100ms ease, -o-transform 500ms ease;
    transition:                 opacity 300ms 100ms ease, transform 500ms ease;

    -webkit-transform: translate3d(15%, 0, 0) scale3d(0.9, 0.9, 0.9);
    -moz-transform: translate3d(15%, 0, 0) scale3d(0.9, 0.9, 0.9);
    -ms-transform: translate3d(15%, 0, 0) scale3d(0.9, 0.9, 0.9);
    -o-transform: translate3d(15%, 0, 0) scale3d(0.9, 0.9, 0.9);
    transform: translate3d(15%, 0, 0) scale3d(0.9, 0.9, 0.9);

    -webkit-transform-origin:0;
    -moz-transform-origin:0;
    -ms-transform-origin:0;
    -o-transform-origin:0;
    transform-origin:0;
}

If the above code snippet isn't causing the issue, it might be related to the JavaScript implementation, which is included in the attached jsFiddle. Any guidance or assistance would be greatly appreciated!

Answer №1

After some time, I was able to solve the issue at hand. For those who may come across this with the same problem in the future, I found that splitting my JavaScript into two separate files (main-L.js and main-R.js) for the Left and Right menus respectively did the trick. Additionally, I had to introduce a new wrapper for the new JavaScript file to function properly. Essentially, I appended an "R" at the end of the classes related to my right menu in both the JavaScript and CSS files.

<div id="outer-wrap">
<div id="inner-wrap">
<div id="inner-wrapR"><!--added wrap here-->

    <div id="top_mobile_bar" class="clearfix">
         <a class="nav-btn" id="nav-open-btn" href="#nav">Menu</a>
         <a class="nav-btn" id="info-open-btn" href="#info">Info</a>
    </div>

The section of CSS that I initially overlooked was responsible for controlling the smooth animation effect. It turned out that #inner-wrap required styling, rather than trying to directly apply transformations to the menu itself as I previously attempted.

     .csstransforms3d.csstransitions.js-navR #inner-wrap {
          -webkit-transform: translate3d(-38%, 0, 0) scale3d(1, 1, 1);
          -moz-transform: translate3d(-38%, 0, 0) scale3d(1, 1, 1);
          -ms-transform: translate3d(-38%, 0, 0) scale3d(1, 1, 1);
          -o-transform: translate3d(-38%, 0, 0) scale3d(1, 1, 1);
          transform: translate3d(-38%, 0, 0) scale3d(1, 1, 1);
      }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Comparison of single-line and multi-line CSS styles placement

There seems to be a debate among CSS developers regarding the preference for multi-line or single-line formatting. Some argue that multi-line is favored for its ease in finding specific properties within the CSS file. However, others believe that single- ...

What is the best way to make my page headers resize with a responsive layout?

Currently, I am working on a website that needs to be fully functional on both mobile devices and computers. I have successfully implemented Bootstrap-responsive to make many elements work, but now I am focusing on the hero-unit for the homepage. Specifica ...

Implementing gridlines on a webpage using HTML and JavaScript to mimic the grid layout found in Visual Studios

Currently, I have a grid snap function in place, however, I am looking to add light grey lines horizontally and vertically on my Designing application. The goal is to achieve a similar aesthetic to Visual Studios' form designing feature. Utilizing so ...

JavaScript debugging causing system freeze

Currently, I am working on a project that involves using MVC and dropdown lists. My issue arises when the dropdown list changes, as there is some javascript code that needs to execute. To troubleshoot the problem of the system locking up every time I tried ...

Tips for getting rid of the glowing effect on MUI slider thumbs when they are in focus

import * as React from "react"; import Box from "@mui/material/Box"; import Slider from "@mui/material/Slider"; function valuetext(value) { return `${value}°C`; } export default function RangeSlider() { const [value, se ...

What steps can I take to ensure a JavaScript loading image is displayed until the entire page has finished loading?

Looking to implement a JavaScript loading image that displays until the page has fully loaded? I'm currently developing an online antivirus scanner and in need of help. I am trying to set up JavaScript to show a loading image while a file is being up ...

Combine the animations of multiple elements in a queue using jQuery

I have a dilemma with the animation of several elements. Rapidly navigating back and forth over the submenu seems to cause a queuing issue, potentially leading to malfunction. I've attempted using stop(), delay(), :animated without success. Any sugge ...

Decode PDF417 barcode images with ease using HTML and JavaScript on both desktop and mobile web browsers

Looking to utilize JavaScript to decode PDF417 type barcode images? If you're encountering Zxing plugin issues in mobile browsers but it works well on desktop browsers with https://github.com/PeculiarVentures/js-zxing-pdf417, consider alternative sol ...

Utilizing third party (jQuery) with AngularJS $compile

Currently, I am integrating angularjs into a website that is already using jquery to load content asynchronously. The content is loaded and then appended to the DOM using jQuery instead of AngularJS. Here is an example of what I have: function loadConte ...

Beautiful image gallery in jQuery Mobile version 1.1.1

Despite PrettyPhoto displaying individual images, the gallery feature is not functioning properly. The code snippet below shows how the image is being rendered on the browser: <a href="/images/reviews/full/2/ii_15986_1429535345455.jpg" data-rel="pretty ...

Issues with the count up functionality in jQuery

I'm currently working on a project involving countups. My aim is to have multiple countups displayed on a single page. While having one countup using interval() function poses no issues, I encounter trouble when trying to display two or more countups ...

changing the visible style of a div element using JavaScript

I'm having an issue with a link on my webpage that is supposed to show or hide a <div id="po" style="display:none;">some html</div> element. The first time I click the link, the div displays properly. However, after tha ...

Is Angular4 preloaded with bootstrap library?

I started a new angular4 project and wrote the code in app.component.html <div class="container"> <div class="row"> <div class="col-md-1">.col-md-1</div> <div class="col-md-1">.col-md-1</div> <div class ...

How to Fix Items Being Pushed Down by 'Particleground' Jquery Plugin Due to Z-Index and Positioning

I'm grappling with understanding z-index and positioning, despite reading various questions and articles on the topic. Currently, I'm attempting to incorporate a Jquery Plugin called 'Particleground': https://github.com/jnicol/particle ...

What is the method for retrieving the text from a span element nested within an anchor tag?

Just curious about how to extract the text from the span element inside the anchor tag. <a class="draw-ticket-wrap"> <span style="display: none;" class="TicketValue">1000</span> <span style="display: none;" class="TicketId">7&l ...

Deciphering JSON File Paths

I'm having trouble finding the correct path to a local file. My directory structure is as follows: Resources -> data -> file.json js -> folder -> script.js html -> folder -> file1.html I ...

When running Javascript code locally, the function works perfectly fine. However, once published, the function encounters a

After spending hours working on cascading dropdown lists and finally getting them to function properly, I published the project only to find that it didn't work as expected. The second list failed to populate. Upon checking Firebug's console, an ...

Struggling to eliminate the unseen padding or white space preventing the text from wrapping under the button

Just starting out with html and css and could use some assistance with a small issue I've come across. While redesigning a website, I have a three-button form (Donate, Find, Subscribe). I'm trying to get the paragraph underneath the Donate and Fi ...

Tips for Identifying Different ID Values of HTML Elements with jQuery

Currently, I have two different divs on my webpage, each containing buttons and hidden fields. When I try to pass the value of the hidden field attached to the button in a jQuery function, I encounter an issue where clicking on the second div results in pa ...

using laravel to make ajax requests with dynamic parameters

I'm facing an issue with an ajax call. The specific url I am trying to retrieve data from is: localhost/public/getCode?course_id=1&task_id=1 This is the ajax call I have set up: function getCode() { $.ajax({ ...