JSFiddle - React, Tailwind, and code Playground

by Agus Sigit Wisnubroto

HTML

<link rel="stylesheet" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<script src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<div id="tt" style="width:700px;height:250px">
  <div title="Tab 1" style="padding:10px">
    <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="Tab 2" style="padding:10px">
    ok
  </div>
  <div title="Tab 3" data-options="closable:true" style="padding:10px">
    test 1
  </div>
  <div title="Tab 4" data-options="closable:true" style="padding:10px">
    test 2
  </div>
</div>

JavaScript

$.extend($.fn.tabs.methods, {
   setTabStyle: function(jq, param) {
     return jq.each(function() {
       var opts = $(this).tabs('options');
       var tab = $(this).tabs('getTab', param.which).panel('options').tab.find('.tabs-inner');
       tab.css(param);
       tab._outerHeight(param.height);
       var margin = opts.tabHeight - param.height;
       tab.css({
         lineHeight: tab[0].style.height,
         marginTop: (opts.tabPosition == 'top' ? margin + 'px' : 0),
         marginBottom: (opts.tabPosition == 'bottom' ? margin + 'px' : 0)
       });
     });
   }
 });


 $(function() {
   $('#tt').tabs({
     narrow: true,
     plain: true,
     tabHeight: 60
   });
   $('#tt').tabs('setTabStyle', {
     which: 0,
     height: 30
   });
   $('#tt').tabs('setTabStyle', {
     which: 1,
     height: 40,
     background: 'yellow'
   });
   $('#tt').tabs('setTabStyle', {
     which: 2,
     height: 40
   });
   $('#tt').tabs('setTabStyle', {
     which: 3,
     height: 60,
     background: 'green',
     color: '#fff'
   });
 })