일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- 이미지세로길이
- array
- 인젝션
- inner join
- update
- MSSQL보안
- jdbc driver
- tempDB
- WML
- instr
- sql랭킹
- sql업데이트
- join
- 정규식
- javascript 한글입력체크
- 한글입력체크
- 이미지가로길이
- FileSystemObject
- VarType
- asp함수
- xmldom
- sql순위
- XML
- ERD
- SPLIT
- wap
- 자바기초
- JavaScript
- injection
- VARIABLE
- Today
- Total
3초기억력
jquery 스마트폰 회전시 제어하는 구문 본문
제목 : jquery 스마트폰 회전시 제어하는 구문
소스 :
function FNareaRelationListCount(){
var areaRelationL = $('#areaRelationList li').length
var areaRelationMaxh = $("#areaRelationList").height();
var areaRelationN = $("#areaRelationList li").filter(function () {
return $(this).position().top + $(this).height() < areaRelationMaxh;
}).length;
if (areaRelationL > areaRelationN)
{
$('#areaRelationBtn').attr('style', 'display:block');
} else {
$('#areaRelationBtn').attr('style', 'display:none');
}
}
var slope = 0;
var supportsOrientationChange = "onorientationchange" in window,
orientationEvent = supportsOrientationChange ? "orientationchange" : "resize";
window.addEventListener(orientationEvent, function() {
if (slope!=window.orientation){
slope = window.orientation;
if(slope == 90 || slope == -90) {
// 가로상태
FNareaRelationListCount();
}
else {
// 세로상태
FNareaRelationListCount();
}
}
}, false);
내용 :
$(window).trigger("orientationchange");
$(window).on("orientationchange", function(e) {
var orientation = window.orientation;
if (orientation == 90 || orientation == -90) {
//alert("landscape");
FNareaRelationListCount();
} else {
//alert("portrait");
FNareaRelationListCount();
}
});
이걸로도 대체 가능
예제 소스 파일 :
출처 :
'코딩_jquery' 카테고리의 다른 글
safari ajax scroll Error 대처법 (0) | 2015.12.08 |
---|---|
jquery ajax 후 이미지 로딩이 완료된 후 append 할수 있는 함수 (0) | 2015.12.01 |
반응형 테이블 2번째 - table reflow (0) | 2015.09.16 |
ajax 이미지 업로드 (0) | 2015.06.30 |
jquery.masonry.min.js (0) | 2015.05.27 |