Mercurial > sat_docs
view printable_cards/xhtml/cmc/specimen_files/easytabs.js @ 153:df75b62e653e
flatpak (build_manifest): some fixes needed after runtime update:
- removed `--optimize=1` for lxml, as it is making the build fail
- added build flag on x86_64 for Pillow (will need to be adapted if we build on other architectures)
- added a module for Python 2.7.16, Python 2 not being included anymore in the runtime
- DEFAULT_MANIFEST modules are put at the beginning of modules
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 28 Jun 2019 15:19:47 +0200 |
parents | dfc5c6be7761 |
children |
line wrap: on
line source
(function($){$.fn.easyTabs=function(option){var param=jQuery.extend({fadeSpeed:"fast",defaultContent:1,activeClass:'active'},option);$(this).each(function(){var thisId="#"+this.id;if(param.defaultContent==''){param.defaultContent=1;} if(typeof param.defaultContent=="number") {var defaultTab=$(thisId+" .tabs li:eq("+(param.defaultContent-1)+") a").attr('href').substr(1);}else{var defaultTab=param.defaultContent;} $(thisId+" .tabs li a").each(function(){var tabToHide=$(this).attr('href').substr(1);$("#"+tabToHide).addClass('easytabs-tab-content');});hideAll();changeContent(defaultTab);function hideAll(){$(thisId+" .easytabs-tab-content").hide();} function changeContent(tabId){hideAll();$(thisId+" .tabs li").removeClass(param.activeClass);$(thisId+" .tabs li a[href=#"+tabId+"]").closest('li').addClass(param.activeClass);if(param.fadeSpeed!="none") {$(thisId+" #"+tabId).fadeIn(param.fadeSpeed);}else{$(thisId+" #"+tabId).show();}} $(thisId+" .tabs li").click(function(){var tabId=$(this).find('a').attr('href').substr(1);changeContent(tabId);return false;});});}})(jQuery);