Accordeon, affichage informations au click
Bonjour,
Je n'arrive pas a faire que mon accordéon quand on click sur le bouton avril il affiche l'information qui est en dessous.
Je ne connais pas la propriété click qui pourrait être valable.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <div id="tab-1" class="tab-content current">
<button><h5 id="moisafficher1" style="text-align: center;"><strong>AVRIL 2018</strong></h5></button>
<div id="moiscacher1">
<p style="text-align: center;">PERFORMANCE HISTORIQUE</p>
<img src="/wp-content/uploads/2018/11/performance_class_A_USD_04.18-historique-Fr_01.png"/>
<p style="text-align: center;">PERFORMANCE HISTORIQUE</p>
<img src="/wp-content/uploads/2018/11/performance_class_A_USD_04.18-historique-Fr_01.png"/>
<p style="text-align: center; margin-top: 7px;">PART DE LIQUIDITÉS</p>
<img class="aligncenter" src="/wp-content/uploads/2018/11/performance_class_A_USD_04.18-liquidite-Fr_01.png" width="330px" height="330px" style="margin-top: 10px; margin-bottom: 20px;">
<p style="text-align: center;">SYNTHÈSE PAR EXPOSITION AUX DEVISES</p>
<img class="aligncenter" src="/wp-content/uploads/2018/11/performance_class_A_USD_04.18-devise-Fr_01.png" width="330px" height="330px" style="margin-top: 10px; margin-bottom: 20px;">
<p style="text-align: center;">SYNTHÈSE PAR EXPOSITION GÉOGRAPHIQUE</p>
<img class="aligncenter" src="/wp-content/uploads/2018/11/performance_class_A_USD_04.18-geographique-Fr_01.png" width="330px" height="330px" style="margin-top: 10px; margin-bottom: 20px;">
<p style="text-align: center;">NOTE DE PORTEFEUILLE</p>
<img class="aligncenter" src="/wp-content/uploads/2018/11/performance_class_A_USD_04.18-portefeuille-Fr_01.png" width="330px" height="330px" style="margin-top: 10px; margin-bottom: 20px;">
<button class="aligncenter bouton" >HISTORIQUE</button>
</div>
</div> |
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| $(function(){
$("[id^='moiscacher']").hide();
$("[id^='moisafficher']").on('change', function(){
menuid = $(this).attr('id').match(/\d+/)[0];
if( $(this).is("click")){
$("[id='moiscacher"+menuid+"']").show();
}
else{
$("[id='moiscacher"+menuid+"']").hide();
}
});
}); |