我怎样才能从左向右滑动这个 React 抽屉
我在React中做了一个抽屉,这是我从互联网上得到的
问题是它总是从右到左滑动,而且我不知道如何让它从左到右滑动
抽屉的CSS代码是:
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
height: 100%;
}
.side-drawer {
position: fixed;
height: 100%;
background: black;
color: white;
top: 0;
right: 0;
width: 40%;
z-index: 200;
box-shadow: 1px 0px 7px rgba(0, 0, 0, 0.5);
transform: translateX(100%);
transition: transform 0.3s ease-out;
}
.side-drawer.open {
transform: translateX(0);
}
我不知道不知道为什么它会这样滑动,我猜这与转换/变换有关
如何让它从左向右滑动?
我为它创建了一个沙箱
预先感谢
拉斐尔
I made a drawer in React, that I got from the internet
The problem is that it always slides from right to left, and I don't know to to make it slide from left to right
The CSS code for the drawer is:
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
height: 100%;
}
.side-drawer {
position: fixed;
height: 100%;
background: black;
color: white;
top: 0;
right: 0;
width: 40%;
z-index: 200;
box-shadow: 1px 0px 7px rgba(0, 0, 0, 0.5);
transform: translateX(100%);
transition: transform 0.3s ease-out;
}
.side-drawer.open {
transform: translateX(0);
}
I don't know why it slides the way it does, I guess it is related to transition/transform
How can I make it slide from left to right?
I made a sandbox for it
Thanks in advance
Rafael
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我得到了它!
这是我的新 CSS:
I got it!
this is my new CSS: