The menu elegantly glides in from the right, fastening itself to the right edge of

I am struggling with the menu animation on my website. Currently, the menu slides in from the left side and covers 30% of the screen. I want to change it so that it slides in from the right and sticks to the right side of the screen. I've attempted to modify the CSS property "left:-150%" to "right:-150px" but it didn't work as expected; instead, the menu just fades in at its current position.

Furthermore, I am also looking to disable page scrolling when the menu is open. Any help would be greatly appreciated!

jQuery(document).ready(function($){
    $('.btn-open-menu').click(function () {
        $('header').addClass('open');
    });

    $('.link-menu').click(function () {
        $('header').removeClass('open');
    });

    $('.btn-close-menu').click(function () {
        $('header').removeClass('open');
    });
});
 html, body {
     width: 100%;
     height: 100%;

    // CSS properties other than the snippet provided are removed for brevity
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<header>
  <a class="btn-open-menu">
    <span class="hamburguer"><img src="/wp-content/uploads/2020/08/hamburger.png"</span>
  </a>
  
  <div class="header-content">
    <a class="btn-close-menu"></a>

    <nav>
     <div class="Menu">
  <ul class="Menu-list" data-offset="10">
    <li class="Menu-list-item" data-offset="20" onclick="location.href='/home';">
      Home
      <span class="Mask"><span>Home</span></span>
      <span class="Mask"><span>Home</span></span>
    </li>
    <li class="Menu-list-item" data-offset="16" onclick="location.href='/about';">
      About
      <span class="Mask"><span>About</span></span>
      <span class="Mask"><span>About</span></span>
    </li>
    <li class="Menu-list-item" data-offset="12" onclick="location.href='/contact';">
      Contact
      <span class="Mask"><span>Contact</span></span>
      <span class="Mask"><span>Contact</span></span>
    </li>

  </ul>
</div>
    </nav>
    
    <div class="social">
      
      
      <a href="https://www.instagram.com/jvaleskasilva/" target="_blank">
        <i class="fab fa-instagram"></i>
      </a>

      <a href="https://www.facebook.com/jvaleskasilva" target="_blank">
        <i class="fab fa-facebook-f"></i></i>
      </a>

    </div>
  </div>
</header>

Answer №1

This can be accomplished with relative ease.

nav .nav-content{left:initial; right: -50%;}
nav.open .nav-content{left:initial; right: 0;}

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

Steps for adding an overlaying image in HTML and SCSS

First step: background-size: cover; Second step: background-size: contain; background-repeat: no-repeat; The third step is what I need: the first background image to be set as cover and the second one as an overlay with no-repeat Currently, my HTML incl ...

Utilizing an AngularJS service to communicate with a web API

Having trouble retrieving data from a web api and passing it back to a JavaScript file. I've tried using http://localhost:8584/api/Testing/5 to see if there are any results, but no luck so far. //This is the JavaScript controller that calls the serv ...

Assign the value of a state by accessing it through a string path key within a complexly

I'm currently attempting to modify a deeply nested value in an object by using a string path of the key to access the object. Here is my setup: const [payload, setPayload] = useState({ name: "test", download: true, downloadConfi ...

Failure to Trigger Error Callback in Ajax Requests

I am encountering an issue with the error callback not being called when I pass the error function as an object parameter in a function. Strangely, when I define it directly within the ajax code, it works without any problems. var options = new Object(); ...

Encountering an error with the node module timestampnotes: 'command not recognized'

I am encountering an issue while trying to utilize a npm package called timestamp notes. After executing the following commands: $npm install timestampnotes $timestamp I receive the error message: timestamp:126: command not found: slk Subsequently, I ...

Eliminate any blank spaces and unproductive searches by utilizing AJAX and CodeIgniter

I am having an issue where I receive results from the database using a jQuery Ajax function when I enter only spaces. However, if I enter a space and then remove it, all results are returned from the database. Can someone please help me fix this problem? H ...

Enhancing Game Security through PHP and jQuery

I am currently developing a game using PHP and jQuery, but I am facing some security issues. The game involves typing combinations correctly, and when the player does so, jQuery sends an ajax request to PHP which then adds 10 points to their session. Below ...

Customizing Material UI: Grouping Tab components within a div container

How can I wrap the children of a Material UI Tabs component in divs? <Tabs value={value} indicatorColor="primary" textColor="primary" onChange={handleChange} > <div> <Tab label="x" /> ...

Jquery plugin experiencing a malfunction

I am encountering an issue with my custom plugin as I am relatively new to this. My goal is to modify the properties of div elements on a webpage. Here is the JavaScript code I am using: (function($) { $.fn.changeDiv = function( options ) { var sett ...

The performance of HTTP requests is significantly decreased in Internet Explorer compared to expected speeds

I am currently developing an Angular site where I need to send a significant amount of data (approximately 1 MB) in an API call. In the Chrome and Firefox browsers, everything works smoothly and quickly, with a response time under one second. However, whe ...

I am experiencing a problem with my Dynamic Table where it duplicates the titles every time a new entry

Attempting to generate dynamic tables using the Repeat Region feature in Dreamweaver CS5 is causing an issue where each new record entry also repeats the table titles when viewed in a browser. COMPANY REF DATE highbury 223333 2014- ...

"Error message: Unresponsive script encountered when trying to submit a jQuery form

I am encountering an error with an unresponsive script in Firefox, and in Chrome the page simply freezes. The issue arises when I try to utilize this code on Wordpress for sending data through AJAX upon form submission. The main objective is to track stat ...

Best practices for sending an object from client to server using Node.js

What is the best way to transfer a large object from client side to my node.js server? The object is currently stored in a variable within my script tags. ...

Dynamically loading components within an Angular application

I am tasked with displaying different components at specific times by iterating through them. Below is an example of how I have attempted to achieve this. The components I can use are determined by the server. <ngb-tabset [activeId]="1"> ...

What is the method for setting a border radius for an infowindow on a Google Map

I'm working with a Google Map InfoWindow and I need to set a border radius for it. Can anyone provide some guidance on how to accomplish this? Below is the code I am currently using: var latlng = new google.maps.LatLng(lat,lng); var myOptions = ...

What is the best way to arrange div elements in this particular manner using CSS?

Wanting to create a specific layout for my website by positioning some divs in a unique way and adding content to them, I have been focusing on responsive design. I am wondering if it is possible to position these divs while ensuring responsiveness. The de ...

Unreliable static URLs with Next.js static site generation

I've recently built a Next.js website with the following structure: - pages - articles - [slug].js - index.js - components - nav.js Within nav.js, I have set up routing for all links using next/link, including in pages/articles/[slug].j ...

Troubleshooting: Issue with WCF service not processing POST requests

I encountered an issue when attempting to call a WCF service using AJAX from another project. The error message displayed was: The server encountered an error processing the request. The exception message is 'The incoming message has an unexpected me ...

Adding an item to a JSON array in Angular

I'm having trouble adding a new item to the roleList JSON array. I've tried using push/concat, but it doesn't seem to update the roleList array. Any suggestions on how to resolve this? // The javascript : function RoleListCtrl($scope) { ...

Searching for a specific data point within the latest entry of a JSON file using Javascript

I am currently in the process of utilizing a sensor to measure temperature, which is then stored in a mongo database. This data can be accessed as a JSON file by visiting ('/data'). My goal is to determine the latest entry and extract the temper ...