如何通过单击按钮并返回原始形式隐藏其右侧/左侧网格时的全宽网格?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何通过单击按钮并返回原始形式隐藏其右侧/左侧网格时的全宽网格?相关的知识,希望对你有一定的参考价值。
我知道如何展示或隐藏一个部分,但却被困住了。我提供截图以便更好地理解。 see image
当我用一个按钮点击隐藏该表单时,我希望左侧表取代右侧表格,然后再按一下按钮点击原始形式。
<div class="row">
<div class="col-md-7 counselingTableDiv" id="counselingTableDivId">
<h3 class="text-center">Counseling Time Table</h3>
<div class="table-responsive">
<table class="table table-bordered" id="counselingTable">
<thead>
<tr>
<th>Sat</th>
<th>Sun</th>
<th>Mon</th>
<th>Tue</th>
<th>Wed</th>
<th>Thu</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<span id="deleteRoutineData" class="btn btn-success">Delete All Routine Data</span>
<span class="btn btn-success" id="setNewRoutine">Set New Routine</span>
</div>
</div>
<div class="col-md-5 counselingSchedulesDiv" id="counselingSchedulesDivId">
<div class="well"><h3>Enter Counseling Schedules</h3></div>
<form action="" method="POST">
<div class="form-group">
<label for="day">Day:</label>
<input type="text" name="day" class="form-control" id="day" placeholder="Day">
</div>
<div class="form-group">
<label for="courseName">Course Name:</label>
<input type="text" name="courseName" class="form-control" id="courseName" placeholder="Course Name">
</div>
<div class="form-group">
<label for="couseCode">Course Code:</label>
<input type="text" name="courseCode" class="form-control" id="courseCode" placeholder="Course Code">
</div>
<div class="form-group">
<label for="time">Starting Time:</label>
<input type="time" name="time" class="form-control" id="time">
</div>
<div class="form-group">
<label for="time">Ending Time::</label>
<input type="time" name="time" class="form-control" id="time">
</div>
<button type="submit" id="submit">Submit</button>
</form>
</div>
在这里,当我隐藏咨询计划时,然后咨询桌面将出现全宽。
答案
向我的小朋友FLEX问好你可以用它做更多的事情看下面的演示,使用全屏查看效果,并将按钮类型从submit
更改为button
。
$(document).ready(function() {
$("#menu").on('click', function() {
$("#counselingSchedulesDivId").toggle();
})
})
.wrapper {
display: flex;
}
.counselingTableDiv {
flex-grow: 1;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Click Here
<i class="fa fa-bars" id="menu"></i>
<div class="wrapper">
<div class="col-md-7 counselingTableDiv" id="counselingTableDivId">
<h3 class="text-center">Counseling Time Table</h3>
<div class="table-responsive">
<table class="table table-bordered" id="counselingTable">
<thead>
<tr>
<th>Sat</th>
<th>Sun</th>
<th>Mon</th>
<th>Tue</th>
<th>Wed</th>
<th>Thu</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<span id="deleteRoutineData" class="btn btn-success">Delete All Routine Data</span>
<span class="btn btn-success" id="setNewRoutine">Set New Routine</span>
</div>
</div>
<div class="col-md-5 counselingSchedulesDiv" id="counselingSchedulesDivId">
<div class="well">
<h3>Enter Counseling Schedules</h3>
</div>
<form action="" method="POST">
<div class="form-group">
<label for="day">Day:</label>
<input type="text" name="day" class="form-control" id="day" placeholder="Day">
</div>
<div class="form-group">
<label for="courseName">Course Name:</label>
<input type="text" name="courseName" class="form-control" id="courseName" placeholder="Course Name">
</div>
<div class="form-group">
<label for="couseCode">Course Code:</label>
<input type="text" name="courseCode" class="form-control" id="courseCode" placeholder="Course Code">
</div>
<div class="form-group">
<label for="time">Starting Time:</label>
<input type="time" name="time" class="form-control" id="time">
</div>
<div class="form-group">
<label for="time">Ending Time::</label>
<input type="time" name="time" class="form-control" id="time">
</div>
<button type="submit" id="submit">Submit</button>
</form>
</div>
</div>
以上是关于如何通过单击按钮并返回原始形式隐藏其右侧/左侧网格时的全宽网格?的主要内容,如果未能解决你的问题,请参考以下文章