Actually, what is the difficulty. There are two tabs on the page. Each of them has two
div 'and on which graphs are drawn via Dygraph .
When the page loads, the first tab displays the graphs as it should, when switching to 2, there are no graphs.
However, as soon as I make an increase or decrease in the size of the page - they appear (disappearing on the previous tab).
I realize that it seems like I need to do resize() selected div , but I don’t understand how.
The plugin itself on the tabs:
(function($) { $(function() { $('ul.tabs__caption').each(function(i) { var storage = localStorage.getItem('tab' + i); if (storage) { $(this).find('li').removeClass('active').eq(storage).addClass('active') .closest('div.tabs').find('div.tabs__content').removeClass('active').eq(storage).addClass('active'); } }); $('ul.tabs__caption').on('click', 'li:not(.active)', function() { $(this) .addClass('active').siblings().removeClass('active') .closest('div.tabs').find('div.tabs__content').removeClass('active').eq($(this).index()).addClass('active'); var ulIndex = $('ul.tabs__caption').index($(this).parents('ul.tabs__caption')); localStorage.removeItem('tab' + ulIndex); localStorage.setItem('tab' + ulIndex, $(this).index()); }); }); })(jQuery);
https://jsfiddle.net/xpvt214o/268215/