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

What is the purpose behind enclosing a function expression in parentheses in JavaScript (apart from creating an IIFE)?

While delving into some advanced JavaScript concepts, I stumbled upon a piece of jQuery code on GitHub that caught my eye. It was an anonymous function wrapped in parentheses, which you can find here. Although I'm familiar with Immediately Invoked Fu ...

What is the best way to display data retrieved through Ajax, jQuery, and JavaScript on an HTML page

I have successfully used the script below to fetch data from an api endpoint and populate my charts. Now, I want not only to display the data in my charts but also directly output it in my HTML code using something like the document.write() function. How ...

Revamping JavaScript Code for Better Performance

I've been working on a lot of code in the backend section of my website, mainly dealing with CRUD operations using AJAX calls. Do you have any suggestions on how I can refactor these functions into more generic ones or possibly create classes instead ...

Is it possible to resize the background-image style?

When using the regular img tag in HTML, you can specify the width and height, and the browser will scale the image. If the dimensions are not too different from the original, the result is usually decent. For example, you can scale the avatar image to 32x ...

Displaying specific data points

I am encountering an issue where I want to select multiple values and have each selected value displayed. However, when I make a selection, I only see one value from a single box. I do not wish to use append because it keeps adding onto the existing valu ...

Concealing information based on the value of a variable

Creating a dynamic price estimator. I need help writing a jQuery function that can hide or show a specific div element based on the value of a variable. For example, let's say I have an HTML div with the ID 'Answer': <div id="answer"&g ...

Discovering checkboxes in HTML using jQuery

Greetings! I have limited knowledge when it comes to using jQuery. I am currently facing an issue with the Checkbox attribute. Below, you will find the code snippet that I have mentioned: Code: $( this ).html() Output: <input name="cb_kot[]" class= ...

Display a specific number of page indicators on the Flickity plugin

Currently, I am utilizing the flickity plugin to create a slideshow feature on my website. My goal is to display navigation dots on the images to facilitate user interaction. If you are interested, you can access the plugin through this link: I would lik ...

"Utilizing Bootstrap to position the right column at the top on a mobile platform

I am in need of assistance with getting the correct div to display on top when viewed on a mobile device using Bootstrap. The issue is discussed and resolved in this particular discussion. To clarify, I would like my desktop layout to appear as follows: A ...

Having trouble centering elements correctly with Bootstrap 5

Just dipping my toes into the world of bootstrap and experimenting with some code. Encountered an issue when trying to center elements properly within columns: <div class="container"> <div class="row"> <div class= ...

Is there a way to have a single background image fill the entire screen?

Can someone help me with my Offcanvas navbar created using Bootstrap? I added a background image from Google as the URL, but instead of one whole piece, it's appearing as 6 duplicate images. What could be the issue here? I tried looking for solutions ...

Just starting to learn jquery and I'm struggling with this code, can someone help?

I am trying to move the .icon element to the right and animate it based on its position().left value. Unfortunately, my code is not working as expected and I can't figure out why. It seems like such a simple task! <script> $("li.menu-item").ho ...

What is the best way to customize multiselection in jqgrid?

jQuery("#grid").jqGrid({ datatype: "local", width:'auto', height: 'auto', multiselect:true, colNames:[ 'no' ], colModel:[ {name:'no', align:'r ...

What is the best way to resize an image for mobile site optimization?

I've been struggling with resizing an image by its width for different mobile devices even after trying to search on Google. Here's what I have attempted: CSS: img.test { width: 100%; height: auto; } HTML: <html> <head> ...

Strange height problem detected in embedded YouTube video

Currently, I have a page with an embedded YouTube video that is intended to be placed in a container with a variable width. When the video is outside of the container, the aspect ratio appears normal. However, once it is placed inside the container, the he ...

In Javascript, a variable is being defined by combining a string with another variable through concatenation

Hey, I'm relatively new to working with Javascript and am facing an issue that I believe can be resolved easily with the right syntax. The problem lies in setting a variable (totalRow1) where it needs to be concatenated with a string and another vari ...

How come the nth-child selector remains unaffected by other selectors?

Here is an example that I have created for this issue: http://jsfiddle.net/SXEty/ <style> table td, th { padding: 8px; text-align: left; } table td:nth-child(1) { color: red; } table td { color: blue } </style> ... <table> <tr> ...

Obtaining array value in JSON and incorporating it into a datatable

I have the following JSON data: { "aaData": [ [ { "displayValue": "Home Page", "link": "http://somelink.com" }, "London", "1983" ], [ { ...

strange JSON structure

I am puzzled by the json output and its relation with jquery. Below is the json data, but the syntax seems quite peculiar: {"ResC": { "@attributes": { "ver": "1.1", "prod": "HAFAS 5.31.VBB.4.8.9", "lang": "DE" }, "STBRes": { "@attributes": {"plan_ ...

How to resolve the issue of a sticky header not functioning properly with a resizable column in Primeng

Currently, I am facing an issue while trying to incorporate both column resize functionality and sticky header in my table. Interestingly, the sticky header feature works perfectly fine when used alone without the column resize. However, when I attempt to ...