Espace entre onglets et sous-forums

Voir le sujet précédent Voir le sujet suivant Aller en bas

Résolu Espace entre onglets et sous-forums

Message par Kyle Firebow Sam 9 Nov 2013 - 22:38

Bonsoir (bonjour) tout le monde !

Je suis fondateur du forum suivant : http://firws-rpg.forumactif.org/

Moi et mes amis sommes en pleine construction du forum (thème phpbb2) et nous rencontrons un problème vis-à-vis de la création de catégories en onglets !
Lorsque nous arrivons sur la page d'accueil du forum, nous obtenons ceci :
Spoiler:

Et lorsque je clique sur l'onglet de droite (intitulé Zone RPG), nous obtenons ceci :
Spoiler:

Comme on peut le remarquer, un espace s'est intercalé... Après de nombreuses recherches, nous n'avons pas su trouver comment rectifier cela, et c'est pourquoi je lance un appel à l'aide ici ^^

Voici le code du template index-box (le seul a avoir été modifié) :
Code:
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
   <tr>
      <td valign="bottom">
         <!-- BEGIN switch_user_logged_in -->
         <span class="gensmall">{LAST_VISIT_DATE}<br />
         {CURRENT_TIME}<br />
         </span>
         <!-- END switch_user_logged_in -->
         <div class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}</div>
      </td>
      <td class="gensmall" align="right" valign="bottom">
         <!-- BEGIN switch_user_logged_in -->
         <a class="gensmall" href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><br />
         <a class="gensmall" href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><br />
         <!-- END switch_user_logged_in -->
         <a class="gensmall" href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a>
      </td>
   </tr>
</table>

   <div id="conteneur_onglets">
      <table><tr>
         <td class="onglet"><div><img src="http://i55.servimg.com/u/f55/17/65/58/72/horsje10.png" /></div></td>
         <td class="onglet"><div><img src="http://i55.servimg.com/u/f55/17/65/58/72/rpg10.png" /></div></td>
      </tr></table>
   </div>
  
<div id="conteneur_categories"><!-- BEGIN catrow --><!-- BEGIN tablehead --><div class="categorie"><table class="forumline" width="100%" border="0" cellspacing="1" cellpadding="0">
   <tr>
      <th colspan="{catrow.tablehead.INC_SPAN}" nowrap="nowrap" width="100%" class="secondarytitle"> {catrow.tablehead.L_FORUM} </th>
      <th nowrap="nowrap" width="150"><div style="width:150px;">{L_LASTPOST}</div></th>
   </tr>
   <!-- END tablehead -->
   <!-- BEGIN cathead -->
   <tr>
      <!-- BEGIN inc -->
      <td class="{catrow.cathead.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
      <!-- END inc -->
      <td class="{catrow.cathead.CLASS_CAT}" colspan="{catrow.cathead.INC_SPAN}" width="100%">
         <h{catrow.cathead.LEVEL} class="hierarchy">
            <span class="cattitle">
               <a class="cattitle" title="{catrow.cathead.CAT_DESC}" href="{catrow.cathead.U_VIEWCAT}">{catrow.cathead.CAT_TITLE}</a>
            </span>
         </h{catrow.cathead.LEVEL}>
      </td>
      <td class="{catrow.cathead.CLASS_ROWPIC}" colspan="3" align="right"> </td>
   </tr>
   <!-- END cathead -->
   <!-- BEGIN forumrow -->
   <tr>
      <!-- BEGIN inc -->
      <td class="{catrow.forumrow.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" alt="." /></td>
      <!-- END inc -->
      <td class="{catrow.forumrow.INC_CLASS}" align="center" valign="middle">
         <img title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" />
      </td>
      <td class="row1 over" colspan="{catrow.forumrow.INC_SPAN}" valign="top" width="100%" height="50">
         <h{catrow.forumrow.LEVEL} class="hierarchy">
            <span class="forumlink">
               <a class="forumlink" href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_NAME}</a><br />
            </span>
         </h{catrow.forumrow.LEVEL}>
         <span class="genmed">{catrow.forumrow.FORUM_DESC}</span>
         <span class="gensmall">
            <!-- BEGIN switch_moderators_links -->
            {catrow.forumrow.switch_moderators_links.L_MODERATOR}{catrow.forumrow.switch_moderators_links.MODERATORS}
            <!-- END switch_moderators_links -->
            {catrow.forumrow.L_LINKS}{catrow.forumrow.LINKS}
         </span>
      </td>
      
      <td class="row3 over" align="center" valign="middle" height="50">
         <table class="case_stats" cellpadding="0" cellspacing="0">
                     <tr>
                           <td class="dernier_msg"><p>{catrow.forumrow.LAST_POST}</p></td>
                     </tr>
                     <tr>
                          <td class="stats_forum"><p>{catrow.forumrow.POSTS} messages | {catrow.forumrow.TOPICS} sujets</p></td>
                     </tr>
               </table>
      </td>
   </tr>
   <!-- END forumrow -->
   <!-- BEGIN catfoot -->
   <tr>
      <!-- BEGIN inc -->
      <td class="{catrow.catfoot.inc.INC_CLASS}" width="46"><img src="{SPACER}" height="0" width="46" /></td>
      <!-- END inc -->
      <td class="spaceRow" colspan="{catrow.catfoot.INC_SPAN}" height="1"><img src="{SPACER}" alt="" height="1" width="1" /></td>
   </tr>
   <!-- END catfoot -->
   <!-- BEGIN tablefoot -->
</table><img src="{SPACER}" alt="" height="5" width="1" /><!-- END tablefoot --></div></div><!-- END catrow -->
Voici le code JavaScript :
Code:
$('document').ready(function()
   {
  if($('.categorie').size() > 1)
    {
      $('#conteneur_onglets').css( 'display' , 'block' );
      $('#conteneur_onglets .onglet').click(function()
      {
         change_categorie( $('.onglet', '#conteneur_onglets').index( this ) )
      });
      
      $('.onglet:eq(0)').click();
}
   });

   function change_categorie( index )
   {
      if( $('.categorie:eq(' + index + ')').size() != 0 )
      {
         $('#conteneur_categories').css( 'min-height' , $('.categorie:eq(' + index + ')').outerHeight() );

        
         $('.categorie').css( 'display' , 'none' );
         $('.categorie:eq(' + index + ')').fadeIn( 500 );
        
         $('.onglet.actif').removeClass('actif');
         $('.onglet:eq('+ index +')').addClass('actif');
      }
      else alert('Vous ne pouvez pas accéder à cette catégorie');
   }
Et enfin, le code CSS correspondant aux onglets des catégories :
Code:
/***** CATAGORIES EN ONGLETS *****/
  
   /* CSS pour le conteneur des catégories */
   #conteneur_categories
   {
      
   }

   /* CSS pour les catégories */  
   .categorie
   {
  
   }
  
   /* CSS pour le conteneur des onglets */
   #conteneur_onglets
   {
      display: none;
   }
  
   /* CSS pour les onglets */
   .onglet
   {
      cursor: pointer;
   }

   #conteneur_onglets table
   {
       margin: auto;
   }
/****** ******/
Merci d'avance Smile


EDIT : J'ai finalement réussi à arranger le problème.

Il suffisait de supprimer la ligne suivante dans le JavaScript :


Code:
$('#conteneur_categories').css( 'min-height' , $('.categorie:eq(' + index + ')').outerHeight() );
Je marque le sujet en résolu Smile
avatar

Kyle Firebow
Nouveau membre

Messages : 2
Inscrit(e) le : 09/11/2013

http://firws-rpg.forumactif.org/
Kyle Firebow a été remercié(e) par l'auteur de ce sujet.

Voir le sujet précédent Voir le sujet suivant Revenir en haut

- Sujets similaires

Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum