slideToggle JQuery right to left

后端 未结 9 864
再見小時候
再見小時候 2021-02-01 05:04

i\'m new in JQ i have this script i found on the internet and its do exactly what i need but i want the sliding will be from the right to the left how can i do it? please help

9条回答
  •  你的背包
    2021-02-01 05:08

    I would suggest you use the below css

    .showhideoverlay { 
      width: 100%;
      height: 100%;
      right: 0px;
      top: 0px;
      position: fixed;
      background: #000;
      opacity: 0.75;
    }
    

    You can then use a simple toggle function:

    $('a.open').click(function() {
      $('div.showhideoverlay').toggle("slow");
    });
    

    This will display the overlay menu from right to left. Alternatively, you can use the positioning for changing the effect from top or bottom, i.e. use bottom: 0; instead of top: 0; - you will see menu sliding from right-bottom corner.

提交回复
热议问题