/** * jQuery.simpleScrollableTab - Very simple jQuery extension for multiple tabs scrolling * Inspired on jQuery.ScrollableTab by Astun Technology Ltd - http://www.astuntechnology.com * Dual licensed under MIT and GPL. * Date: 09/09/2011 * @author Irving A. Bermúdez S. - bigchirv(at)gmail(dot)com * @version 0.2 */ (function($){ $.fn.nextTab = function() { var $tabsNav = $(this).find('.ui-tabs-nav'); var current = $tabsNav.find('li.ui-tabs-active'); current.removeClass('active'); if(current.next().attr('id_sistem') == 'centralizator') { $('.camp-parametru').hide(); $('.catalog-button').show(); } else { $('.camp-parametru:first').show(); $('.catalog-button').hide(); } do { current = (current.is(':last-child')) ? $tabsNav.find('li:first-child') : current.next(); if (!current.hasClass('ui-state-disabled')) { return current; } } while (true); } $.fn.prevTab = function() { var $tabsNav = $(this).find('.ui-tabs-nav'); var current = $tabsNav.find('li.ui-tabs-active'); current.removeClass('active'); if(current.prev().attr('id_sistem') == undefined) { $('.camp-parametru').hide(); $('.catalog-button').show(); } else { $('.camp-parametru:first').show(); $('.catalog-button').hide(); } do { current = (current.is(':first-child')) ? $tabsNav.find('li:last-child') : current.prev(); if (!current.hasClass('ui-state-disabled')) { return current; } } while (true); } $.fn.simpleScrollableTab = function() { return this.each(function(){ var $tabs = $(this); var $tabsNav = $tabs.find('.ui-tabs-nav'); var scrollSettings = { axis:'x', offset: { left: -350 } } $tabs.css({'padding':2, 'position':'relative'}) .prepend('