2017-02-15 5 views
0

'기타'라는 확인란에 초점을 맞추면 텍스트 영역이 표시되므로 다른 체크 박스에서 해당 옵션을 클릭 할 때만 필요합니다. (http://air.abricot-production.com/alliance-of-independent-restaurants/restaurant-membership-application.html).jQuery가 모바일에서 작동하지 않는 경우

<script> 
    $(document).ready(function(){ 
     $(".BusTypeOtherTextArea").hide(); 
      $(".BusTypeOther").focus(function() { 
       $(".BusTypeOtherTextArea").show("fast"); 
       return false; 
      }); 
     }); 
    </script> 

모바일에서는 포커스가 잘 동작합니까? 클릭을 사용하면 두 가지 모두에서 작동하지만 선택되어있는 체크 상자는 그대로 두지 않습니다. 모바일에서이 작업을 수행하려면 어떻게해야합니까?

답변

0

이 솔루션은 작동하지 않습니다 :

$(document).ready(function(){ 
    $(".BusTypeOtherTextArea").hide(); 
     $(".BusTypeOther").one('click focus', function() { 
      $(".BusTypeOtherTextArea").show("fast"); 
      return false; 
     }); 
    }); 
0

난 내가 뭔가를해야 보는 바와 같이, 이것에 대한 해결 방법을 생각 뭔가 같은 : 모바일 (태블릿/전화) 장치에서이 제스처를 해달라고 특히

$('.checkBox').click(function(){ 
    if($(this).prop('checked')) { 
    // show textarea 
    } else { 
    // hide 
    } 
}); 

내가 초점을 사용하지 않는 것이 좋습니다.

+0

내 testarea는 더 이상 시작하는 숨겨져 있습니다. ( $ ("BusTypeOther.")을 클릭합니다;.. 죄송합니다 $ (문서) .ready (함수() { $ (". BusTypeOtherTextArea") 숨기기() 들여 쓰기 등을 가진 코드로 포맷 할 수없는 것 { if ($ (this) .prop ("checked")) { $ (". BusTypeOtherTextArea"). ("빠름"); }), }); –

+0

해결하셨습니까? –

+0

감사합니다 Ben, .one ('click focus', function()은 좋은 해결책 인 것 같습니다. –

관련 문제