JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<link rel="stylesheet" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<script src="http://www.jeasyui.com/easyui/datagrid-groupview.js"></script>
<script>
function onBeforeOpen(){
var title = $(this).panel('options').title;
console.log('before opening '+title)
if (title == 'Help'){
return false;
}
}
</script>
<div class="easyui-tabs" style="width:700px;height:250px" id="tt">
<div title="About" style="padding:10px" data-options="onBeforeOpen:onBeforeOpen">
<p style="font-size:14px">jQuery EasyUI framework helps you build your web pages easily.</p>
<ul>
<li>easyui is a collection of user-interface plugin based on jQuery.</li>
<li>easyui provides essential functionality for building modem, interactive, javascript applications.</li>
<li>using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.</li>
<li>complete framework for HTML5 web page.</li>
<li>easyui save your time and scales while developing your products.</li>
<li>easyui is very easy but powerful.</li>
</ul>
</div>
<div title="My Documents" style="padding:10px" data-options="onBeforeOpen:onBeforeOpen">
<ul class="easyui-tree" data-options="method:'get',animate:true"></ul>
</div>
<div title="Help" data-options="iconCls:'icon-help',closable:true,onBeforeOpen:onBeforeOpen" style="padding:10px">
This is the help content.
</div>
</div>
JavaScript
$('#tt').tabs({
onBeforeClose: function(title,index){
var target = this;
$.messager.confirm('Confirm','Are you sure you want to close '+title,function(r){
if (r){
var opts = $(target).tabs('options');
var bc = opts.onBeforeClose;
opts.onBeforeClose = function(){}; // allowed to close now
$(target).tabs('close',index);
opts.onBeforeClose = bc; // restore the event function
}
});
return false; // prevent from closing
}
});