1/** simle tab **/ 2 3/** 4 * simpleTabs ( http://supercanard.phpnet.org/jquery-test/simpleTabs/ ) 5 * plugin jQuery pour afficher des bï¾ï½´ites d'onglet. 6 * 7 * Version 1.0 8 * 9 * Auteur : Jonathan Coulet ( [email protected] ) 10 * 11 **/ 12(function($){ 13 $.fn.simpleTabs = function(option){ 14 // Param plugin 15 var param = jQuery.extend({ 16 fadeSpeed: "medium", // @param : low, medium, fast 17 defautContent: 1, // @param : number ( simpleTabs-nav-number) 18 autoNav: "false", // @param : true or false 19 closeTabs : "true" // @param : true or false; 20 }, option); 21 $(this).each(function() { 22 // Initialisation 23 var $this = this; 24 var $thisId = "#"+this.id; 25 var nbTab = $($thisId+" > div").size(); 26 autoNav(); 27 showCloseTabs(); 28 hideAll(); 29 changeContent(param.defautContent); 30 // Fonctions 31 function hideAll(){ 32 // Masque tous les content 33 $($thisId+" .simpleTabs-content").hide(); 34 } 35 function changeContent(indice){ 36 // Masque tous les content - Supprime la classe actif de tous les onglets 37 // Ajoute la classe actif ï¾� l'onglet cliquï¾ï½© - Affiche le content ciblï¾ï½© - Execute showCloseTabs 38 hideAll(); 39 $($thisId+" .simpleTabs-nav li").removeClass("actif"); 40 $($thisId+" #simpleTabs-nav-"+indice).addClass("actif"); 41 $($thisId+" #simpleTabs-content-"+indice).fadeIn(param.fadeSpeed); 42 showCloseTabs(); 43 } 44 function autoNav(){ 45 // Gï¾ï½©nï¾ï½¨re les onglets automatiquement 46 if(param.autoNav == "true"){ 47 var listeNav = ''; 48 for(i=1; i!=nbTab; i++){ 49 listeNav = listeNav+'<li id="simpleTabs-nav-'+i+'">'+i+'</li>'; 50 } 51 $($thisId+" .simpleTabs-nav").append('<ul>'+listeNav+'</ul>'); 52 } 53 } 54 function showCloseTabs(){ 55 // Gï¾ï½©nï¾ï½©re un bouton de fermeture gï¾ï½©nï¾ï½©rale des content 56 if(param.closeTabs == "true"){ 57 if($($thisId+" .simpleTabs-nav li.close").size() == 0){ 58 $($thisId+" .simpleTabs-nav ul").append("<li title=\"Fermer tous les onglets\" class=\"close\">x</li>"); 59 } 60 } 61 } 62 // Exec 63 $($thisId+" .simpleTabs-nav li").click(function(){ 64 var numContent = this.id.substr(this.id.length-1,this.id.length); 65 changeContent(numContent); 66 }); 67 // test function closeTabs 68 $($thisId+" .simpleTabs-nav li.close").click(function(){ 69 hideAll(); 70 $($thisId+" .simpleTabs-nav li").removeClass("actif"); 71 $($thisId+" .simpleTabs-nav li.close").remove(); 72 //alert($($thisId+" .simpleTabs-nav li.close").size()); 73 }); 74 }); 75 } 76})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.