2017-10-16 5 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