jQuery UI Tabs and Highcharts display/rendering issue

前端 未结 13 2332
长发绾君心
长发绾君心 2020-12-28 18:57

Anyone ever used the tabs (jquery-ui-1.8.9) and pie charts from Highcharts 2.1.4 together? To put it simply, I have multiple tabs, where each tab s

13条回答
  •  自闭症患者
    2020-12-28 19:24

    jQuery UI 1.9+ changed the way tabs are hidden, you should set your own classes when activating tabs this way:

    $('#tabs').tabs({
      beforeActivate: function (event, ui) {
        $(ui.oldPanel).addClass('ui-tabs-hide');
        $(ui.newPanel).removeClass('ui-tabs-hide');
      }
    });
    

    combined with the following CSS:

    .ui-tabs-hide { 
      display: block !important; 
      height: 0!important; 
      width: 0!important; 
      border:none!important; 
    }
    

    This will also fix any Flash embedded object not loading properly in hidden tabs.

提交回复
热议问题