如何捕捉小组闭幕事件

How to catch the panel closing event

本文关键字:闭幕 事件 何捕捉      更新时间:2023-09-26

$(document).ready(function(){
		$('#hide').on('click', function (e) {
			$('#current-pane).show()
		});
	});
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<div class="panel-group">
	<div class="panel panel-default" id="current-pane">
      This is First Panel
      <a href="#current-pane" class="btn btn-primary btn-lg" data-dismiss="alert" aria-label="close" id="hide">Finish Call</a>
    </div>
  
  	<div class="panel panel-info hide" id="current-pane">
      Show me on close of first one
    </div>
  </div>

我的要求是在完成所有操作后关闭div,并显示选择另一个操作的其他div。

因此,我认为引导面板组件会有所帮助。请不要我不是在寻找崩溃效果。我想以某种动画方式做到这一点,以便给人的印象是工作div 已关闭。

我正在努力寻找小组关闭事件。

div

id必须是唯一的,例如current-pane1current-pane2等。

$(document).ready(function(){
		$('#hide').on('click', function (e) {
			$('#current-pane1').slideToggle();
			$('#current-pane2').removeClass("hide");
		});
	});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<div class="panel-group">
	<div class="panel panel-default" id="current-pane1">
      This is First Panel
      <a class="btn btn-primary btn-lg" data-dismiss="alert" aria-label="close" id="hide">Finish Call</a>
    </div>
  
  	<div class="panel panel-info hide" id="current-pane2">
      Show me on close of first one
    </div>
  </div>