matchMedia() 함수 혹은 $(document).width()
/* 1024px 보다 작을경우 : Not Flexible */
if (matchMedia("screen and (max-width: 1024px)").matches) {
$('#menu-item-1 > a > span').text('AAA');
$('#menu-item-2 > a > span').text('BBB');
} else {
$('#menu-item-1 > a > span').text('CCC');
}
/* 1024px 보다 작을경우 : Not Flexible */
if($(window).width() < 1024){ $('#Container').removeAttr('id'); }
'jQuery' 카테고리의 다른 글
[jQuery] 연산자, 조건문, prompt, alert (0) | 2018.02.25 |
---|---|
[jQuery] data 선택 및 수정 (0) | 2018.02.19 |
[jQuery] display 여부에 따라 show, hide (0) | 2018.02.01 |
[jQuery] Request Parameter 받기 (0) | 2018.01.10 |
[javascript] http와 https 구분없이(혹은 구분해서) 페이지 로딩 (0) | 2017.12.20 |