Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function($) {
- jQuery('div.tx-jfmulticontent-pi1 > div.ui-tabs').each(function() {
- var $navigation = jQuery('ul.ui-tabs-nav', this);
- var $listItems = jQuery('li.ui-state-default', $navigation);
- var width = $navigation.width();
- var staticWidth = 0;
- $listItems.each(function() {
- var $this = jQuery(this);
- if ($this.text().indexOf(' ') > -1) {
- $this.addClass('flexible');
- } else {
- $this.addClass('static');
- staticWidth += $this.width();
- }
- width -= $this.outerWidth() - $this.width();
- });
- var $flexibleListItems = $listItems.filter('.flexible');
- var $staticListItems = $listItems.filter('.static');
- if ($flexibleListItems.length && $staticListItems.length) {
- width = (width - staticWidth) / $flexibleListItems.length;
- $flexibleListItems.width(width);
- } else {
- width = width / $listItems.length;
- $listItems.width(width);
- }
- var height = Math.max.apply(null, $listItems.map(function() {
- return jQuery(this).height();
- }));
- $listItems.height(height);
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement