我正在开发一个门户,目前正在设计 UI。我在这里使用框架集。当我单击侧边栏中的任何链接并且网页在右(右)框架中加载时,我需要最小化左框架(即侧边栏/菜单)。侧边栏的最小化版本只显示选项卡的图标,我想要一个箭头键,如果单击它会再次最大化侧边栏。一种
这是我的 frame.html 的代码
<!DOCTYPE html>
<html>
<frameset cols="15%,*" scrolling="yes">
<frame name = "left" src="menu.html" scrolling="yes">
<frame name = "center">
</frameset>
</html>
我的侧边栏/菜单代码是 menu.html
<!DOCTYPE html>
<html>
<head>
<!--Link to the CSS style sheet-->
<link rel="stylesheet" href="css/menu.css">
<script src="https://kit.fontawesome.com/5c399403c6.js"></script>
</head>
<body>
<!--Sidebar/Menu-->
<div class="wrapper">
<div class="menu">
<!--Logo comes here-->
<h2>Alfred</h2>
<!--Search Bar-->
<div class="search">
<!--Links in the sidebar/menu-->
<ul>
<li><input class="search-text" type="text" placeholder="Search here" name="">
<a class="search-button" href="#">
<i class="fas fa-search"></i>
</li>
<li><i class="fas fa-chart-line"></i><a href="dashboard.html" target ="center" >Dashboard</a></li>
<li><i class="fas fa-building"></i><a href="hq.html"target ="center" >HQ</a></li>
<li><i class="fas fa-file-invoice-dollar"></i><a href="accounts.html"target ="center">Accounts</a></li>
<li><i class="fas fa-users"></i><a href="people.html"target ="center">People</a></li>
<li><i class="fas fa-at"></i><a href="mail.html"target ="center">Mail</a></li>
<li><i class="fas fa-handshake"></i><a href="crm.html"target ="center">CRM</a></li>
<li><i class="fas fa-calendar-alt"></i><a href="calendar.html"target ="center">Calendar</li>
<li><i class="fas fa-clipboard-list"></i><a href="board.html"target ="center">Board</a></li>
<li><i class="fas fa-archive"></i><a href="files.html"target ="center">Files</a></li>
<li><i class="fas fa-headset"></i><a href="desk.html"target ="center">Support Desk</a></li>
<li><i class="fas fa-cogs"></i><a href="settings.html"target ="center">Settings</li>
</ul>
</div>
</div>
</body>
</html>
我的样式表是 menu.css
@import url('https://fonts.googleapis.com/css?family=Muli&display=swap');
@import url('https://fonts.googleapis.com/css?family=Raleway&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
list-style: none;
text-decoration: none;
font-family: 'Muli', sans-serif;
}
i{
margin: 10px;
}
body{
background: #391E57;
}
.wrapper{
display: flex;
position: relative;
color: #ECE4F4;
}
.wrapper .menu {
position: fixed;
width: 200px;
height: 100%;
background: #391E57;
padding: 30px 0;
}
.wrapper .menu h2{
color: #fff;
text-align: center;
margin-bottom: 30px;
font-family: 'Raleway', sans-serif;
letter-spacing: 4.5px;
transition: all .2s ease-in-out;
}
.wrapper .menu h2:hover{
color: #53D2F5;
transform: scale(1.1);
}
.search-text{
width: 140px;
height: 25px;
}
.wrapper .menu ul li{
padding: 5px;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
border-top: 1px solid rgba(225, 225, 225, 0.05);
}
.wrapper .menu ul li a{
color: #9F9CA2;
display: inline;
}
.wrapper .menu ul li .fas{
width: 25px;
color: #9F9CA2;
transition: all .2s ease-in-out;
}
.wrapper .menu ul li:hover .fas{
color: #53D2F5;
transform: scale(1.1);
}
.wrapper .menu ul li:hover{
background: #79668F;
}
.wrapper .menu ul li:hover a{
color: #fff;
}