jquery左右滑动菜单
<div class="mini-container" style="position:relative;height:100%;">
<div class="left-collapse-trigger" title="隐藏侧边栏">
<i class="fa fa-angle-left fa-2x"></i>
</div>
<div class="bg-info min-condition condition-content" data-id="condition-info">
</div>
</div>
<style scoped>
.left-collapse .min-condition {
width: 0px !important;
overflow: hidden !important;
padding: 0px !important;
}
.left-collapse-trigger {
width: 40px;
height: 40px;
border-radius: 20px;
background: rgba(202, 202, 202, 0.4);
position: absolute;
left: 240px;
top: 45%;
z-index: 1000;
justify-content: center;
align-items: center;
color: #fff;
display:flex;
}
.left-collapse .left-collapse-trigger {
left:-10px;
}
.condition-content {
position: absolute;
transition: width 200ms;
z-index: 999;
left: 0px;
top: 0px;
bottom: 0px;
overflow: auto;
width: 260px;
padding: 15px;
background: #f7f5f5;
}
.main-content {
position: absolute;
left: 265px;
right: 0px;
top: 0px;
bottom: 0px;
}
</style>
define([], function () {
return function () {
this.show = function (module, root) {
root.load("telemetry/dataSearch/cesi.html", function () {
//侧边栏绑定
(function () {
$("body").on("click", ".left-collapse-trigger", function () {
$(this).attr("title", "展开侧边栏");
var $brother = $(this).parent();
var isExpand = true;
if ($brother.hasClass("left-collapse")) {//已经折叠
$brother.removeClass("left-collapse");
$(this).attr("title", "隐藏侧边栏");
$(this).children("i").removeClass("fa-angle-right").addClass("fa-angle-left");
}
else {
isExpand = false;
$brother.addClass("left-collapse");
$(this).attr("title", "展开侧边栏");
$(this).children("i").removeClass("fa-angle-left").addClass("fa-angle-right");
}
});
}());
});
}
};
});
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南