다음 코드가 실행 중이며 모바일 장치를 사용하는 경우 중지해야합니다.
jQuery(document).ready(function($){
var inHeight = $("#wrapper").innerHeight();
$("#wrapper .col").each(function(){
$(this).height(inHeight+"px");
$(this).find('.content').height((inHeight-60)+"px");
});
});
내가 좋아하는 뭔가를 사용할 수 if($(window).width()<600){ /* do something */ }
내가 곡선 괄호 사이에 무엇을 쓸 것이다 그런 경우를?
감사합니다!
당신은 시도 할 수 있습니다:
if(!(/iPhone|iPad|iPod|Android|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent) )) {
jQuery(document).ready(function($){
var inHeight = $("#wrapper").innerHeight();
$("#wrapper .col").each(function(){
$(this).height(inHeight+"px");
$(this).find('.content').height((inHeight-60)+"px");
});
});
}
따라서 모바일 장치 가 아닌 경우 코드를 실행합니다.
$(window).width
그것을 사용 하는 것은 좋은 해결책이 아닙니다. 모바일 장치를 사용하지 않고 브라우저 창에서 크기 만 변경하면 어떻게되는지 생각해보십시오.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다