2017-10-16 79 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.让输入收音机在里面工作<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

您可能需要做一个onclick jquery/javascript来切换单选按钮。看到这里https://stackoverflow.com/questions/19141911/toggling-radio-buttons-with-jquery – designtocode

回答

0

解决!这里是我添加的jQuery代码。

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

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