2017-10-16 9 views
0

I'm trying to make tabbed comments section for WordPress. I use jQuery UI tabs to make it work. I have styled radio switches between tags but it does not works. When I click a tab, link click happens and radio button does not change.L'entrée radio fonctionne à l'intérieur <a href>

my code for first <li> element looks like this:

<li class="active ui-state-default ui-corner-top ui-tabs-active ui-state-active" id="comments-evolved-Facebook-control" role="tab" tabindex="0" aria-controls="comments-evolved-Facebook-tab" aria-labelledby="ui-id-1" aria-selected="true" aria-expanded="true"> 
    <a href="#comments-evolved-Facebook-tab" class="ui-tabs-anchor" role="presentation" tabindex="-1" id="ui-id-1"> 
     <div class="switch switch-Facebook"> 
      <input name="multicomments" id="Facebook-toggle" class="switch-control" type="radio"> 
      <label class="switch-toggle" for="Facebook-toggle"> 
       <div class="switch-handle"><span><i class="icon-multicommentsFacebook"></i></span> 
       </div> 
      </label> 
     </div><span id="comments-evolved-Facebook-label">Label Example</span> 
    </a> 
</li> 

see actual WordPress page: Page with comments

+0

Vous devrez peut-être effectuer un clic sur jclery/javascript pour activer le bouton radio. Voir ici https://stackoverflow.com/questions/19141911/toggling-radio-buttons-with-jquery – designtocode

Répondre

0

Résolu! Voici le code jQuery que j'ai ajouté.

jQuery('#".$tab."').click(function() { 
    jQuery('#".$tab."-toggle').prop('checked', true); 
}); 

`".$tab."` is the `<li>` element ID