0

i have addded a menu icon and side menu for mobile devices.

when menu icon is clicked side menu will be visible.

iam trying to add a ease in animation on opening side menu. but when iam adding transform property the background of sidemenu becomes transparent,when i commented out those lines it works fine without animation.

why the background become transparent on adding transform property?

how to acheive this animation on opening side menu.

    .menu {
       transform: translateX(70%);// commenting this line and 
       transition: all 0.5s ease-in;

       opacity: 0;

        pointer-events: none;

        visibility: hidden;
        display: none;
        width: 0;
        height: 0;
    }
   .menu-active {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        transform: translateX(0);//commenting this line
        display: block;
        width: 100%;
        height: 100%;
        z-index: 9999999;
   }

i have created two pens to show the issue?

  1. without transform ( works fine but no animation ) https://codepen.io/sinan-m/pen/QWxzveK

  2. with transform arises issue https://codepen.io/sinan-m/pen/bGKORgw

sinan
  • 133
  • 8

0 Answers0