2012-05-07 8 views
0

여기에 제 체크 박스 slideDown 솔루션의 예가 있습니다. http://jsfiddle.net/kNpYz/3/jQuery slideDown 2 html 케이스

일부 요소가 slideDown 또는 slideUP이 될 수 있도록 확인란을 선택하면 제대로 작동하지만 HTML을 변경할 때. jQuery 마크 업을 변경해야한다는 것을 알고 있지만 어떻게해야할지 모르겠다.

<div id="section-uvitaci_text" class="section section-checkbox ibutton"> 
    <h3 class="heading">Uvítací text</h3> 
    <div class="option"> 
    <div class="controls"> 
     <input type="hidden" class="fld checkbox aq-input" name="uvitaci_text" id="uvitaci_text" value="0"> 
     <div class="ibutton-container"> 
     <input type="checkbox" class="fld checkbox of-input" name="uvitaci_text" id="uvitaci_text" value="1" checked="checked"> 
     <div class="ibutton-handle" style="left: 50px; "> 
      <div class="ibutton-handle-right"> 
      <div class="ibutton-handle-middle"></div> 
      </div> 
     </div> 
     <div class="ibutton-label-off"><span style="margin-right: -50px; "> 
      <label>OFF</label> 
      </span></div> 
     <div class="ibutton-label-on" style="width: 54px; overflow-x: hidden; overflow-y: hidden; "><span style="margin-left: 0px; "> 
      <label>ON</label> 
      </span></div> 
     <div class="ibutton-padding-left"></div> 
     <div class="ibutton-padding-right"></div> 
     </div> 
    </div> 
    <div class="explain">This will show an offline message. Except for administrators, nobody will be able to access the site</div> 
    <div class="clear"> </div> 
    </div> 
</div> 

효과가 작동하지 않습니다. 이 HTML 경우에 대해 내 j에서 무엇을 변경해야합니까? 동일한 ID와 존재하지 않는 JQuery와에 슬라이딩 ID를 가진 두 개의 컨트롤이있을 어차피 같은

jQuery('.fld').click(function() { 
    $(this).closest('.option').find('.explain').slideToggle('normal', "swing"); 
    }); 

답변

0

사용이 jQuery 코드에 대한

들으 이 :

Correct code

+0

HTML이 플러그인에 의해 생성되는 http://www.givainc.com/labs/ibutton_jquery_plugin.htm 당신의 코드를위한 thx :) – user13746

+0

@ user13746 그래서 자동으로 생성 된 HTML 인 경우, 편집 된 jquery 코드 –

+0

을 사용하고 다음과 같이 쓸 수 있습니까? .find ('F _'+ this.id) 여기 – user13746

0

귀하의 HTML 많은 오류가 시도 : 시간