jquery - 将元素从折叠的侧边栏拖到正文
问题描述
我正在尝试将元素从侧边栏面板拖动到页面正文,但它不会落在正文中。
当我初始化可拖动元素但没有成功时,我已经尝试了很多选项。
这就是我的可拖动对象的初始化方式:
$('.draggable-dash').draggable({
revert: "invalid",
helper: 'clone',
appendTo: '.dropdashboard',
containment: 'body',
//zIndex: 2500,
scroll: false,
cursorAt: { top: -5, left: -5 },
start: function(){
$(this).hide();
},
stop: function(){
$(this).show()
}
});
这是面板 css
.theme-panel {
position: fixed;
right: -175px;
top: 150px;
z-index: 1020;
background: #fff;
padding: 15px;
width: 175px;
transition: right .2s linear;
border-radius: 4px 0 0 4px;
}
.theme-panel.theme-panel-lg .theme-panel-content {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: scroll;
margin: 0;
padding: 20px;
}
这是正在发生的事情的图像。如您所见,元素在拖动模式下的位置也是错误的。
我不知道该怎么做才能解决它:(
解决方案
推荐阅读
- flutter - Flutter listview 总是扩展到可用宽度
- sql - DBeaver 右键单击数据库和工具 -> 执行脚本:如何指定哪个模式?
- latex - 乳胶:为一列着色
- json - 对必需但未知的键名进行 JSON 模式验证
- python - 调用外部API时如何在pycharm中解决“NewConnectionError:无法建立新连接[Errno 11001]”
- php - 如何在 pre_match_all 中满足单引号
- node.js - nodejs fs createWriteStream 保存多个同名文件
- javascript - 过滤和组合两个用户搜索 - React/TypeScript
- javascript - addEventListener 点击有效,但鼠标悬停无效
- asp.net-mvc - asp net 在 _layout 页面中添加组合