One jquery plug-in every day-water one day layout
Water day layout
After getting the basic layout before, I feel pretty awesome, but now I find that I don’t use it at all. For example, I spent a lot of time trying to control how to control in jquery. In fact, it’s just a matter of choosing the right way for CSS layout. Take a note today, a very simple layout
The effect is as follows
Code part
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>水一天布局</title>
<script src="js/jquery-3.4.1.min.js"></script>
<style>
* {
margin: 0px;
padding: 0px;
user-select: none;
}
html,
body {
width: 100%;
height: 100%;
}
body {
position: relative;
}
.flexcc{
display: flex;
justify-content: center;
align-items: center;
transition: all 0.5s linear;
}
#head {
position: absolute;
top: 0px;
width: 100%;
height: 60px;
border-bottom: 1px solid lightgray;
}
#left {
position: absolute;
top: 60px;
left: 0px;
bottom: 0px;
width: 200px;
border-right: 1px solid lightgray;
}
#right {
position: absolute;
top: 60px;
bottom: 0px;
left: 200px;
right: 0px;
border-left: 1px solid red;
}
#left.check{
width: 20px;
}
#right.check{
left: 20px;
}
</style>
</head>
<body>
<div id="head" class="flexcc">头部</div>
<div id="left" class="flexcc">左边</div>
<div id="right" class="flexcc">右边</div>
</body>
</html>
<script>
$("#head").click(function(){
$("#left,#right").toggleClass("check")
})
</script>
No idea