我一直在研究一种在CSS上模拟拖动事件的方法。但我什么也没找到。我想做的是创建一个类似于Gmail应用程序菜单的移动菜单,我可以通过拖动它来查看它。有什么想法吗?提前感谢您的帮助!!
发布于 2019-09-04 17:02:34
可以,停那儿吧!这里有一个例子:https://codepen.io/100ants/pen/zYOPNrV
<textarea name="" id="" cols="30" rows="10" readonly></textarea>
<div class="menu">
Menu!
<div class="handle"></div>
</div>body, html {
margin: 0;
padding: 0;
}
textarea {
height: 15px;
resize: vertical;
width: calc(50% + 9px);
position: relative;
z-index: 1;
box-sizing: border-box;
max-height: 118px;
cursor: unset;
min-height: 30px;
opacity: 0;
}
.menu {
background: #37474f;
padding: 50px 20px;
color: #fff;
margin-top: -131px;
position: relative;
.handle {
position: absolute;
top: 100%;
left: 50%;
width: 18px;
height: 18px;
background: #ffca28;
transform: translate(-50%, -50%);
border-radius: 50%;
border: 5px solid #fff;
}
}https://stackoverflow.com/questions/57726136
复制相似问题