Javascript 如何使导航从右向左打开?
我尝试过摆弄这个导航的css,但无法从右到左打开它Javascript 如何使导航从右向左打开?,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我尝试过摆弄这个导航的css,但无法从右到左打开它 .hamburger{ $width:25px; $height:3px; width:$width; height:$height; background:white; display:block; position:absolute; top:50%; left:50%; margin-left:-$width/2; margin-top:-$height/2; transition:tran
.hamburger{
$width:25px;
$height:3px;
width:$width;
height:$height;
background:white;
display:block;
position:absolute;
top:50%;
left:50%;
margin-left:-$width/2;
margin-top:-$height/2;
transition:transform 200ms;
}
改变
transform:translate3d(110px*$i,0,0);
到
在以下css代码中,使其从右向左打开:
.menu-open:checked~.menu-item{
transition-timing-function:cubic-bezier(0.165, 0.840, 0.440, 1.000);
@for $i from 1 through $menu-items{
&:nth-child(#{$i+2}){
transition-duration:90ms+(100ms*$i);
transform:translate3d(-110px*$i,0,0);
}
}
}
改变
transform:translate3d(110px*$i,0,0);
到
在以下css代码中,使其从右向左打开:
.menu-open:checked~.menu-item{
transition-timing-function:cubic-bezier(0.165, 0.840, 0.440, 1.000);
@for $i from 1 through $menu-items{
&:nth-child(#{$i+2}){
transition-duration:90ms+(100ms*$i);
transform:translate3d(-110px*$i,0,0);
}
}
}
在SCS最末端的循环中有一个
转换:translate3d(110px*$i,0,0)代码>
将此值更改为负值,-110px
将使动画从右向左显示。但是,您还需要更新一些其他CSS,我将把它们留给您。在SCS最末端的循环中有一个转换:translate3d(110px*$I,0,0)代码>
将此值更改为负值,-110px
将使动画从右向左显示。但是,您还需要更新一些其他CSS,我将把它们留给您。您需要添加-110px以右转
.menu-open:checked~.menu-item{
transition-timing-function:cubic-bezier(0.165, 0.840, 0.440, 1.000);
@for $i from 1 through $menu-items{
&:nth-child(#{$i+2}){
transition-duration:90ms+(100ms*$i);
transform:translate3d(-110px*$i,0,0);
}
}
}
然后移除svg
您需要添加-110px才能向右转弯
.menu-open:checked~.menu-item{
transition-timing-function:cubic-bezier(0.165, 0.840, 0.440, 1.000);
@for $i from 1 through $menu-items{
&:nth-child(#{$i+2}){
transition-duration:90ms+(100ms*$i);
transform:translate3d(-110px*$i,0,0);
}
}
}
然后移除svg