jQuery2018. 2. 5. 02:59

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'); }

Posted by cpu21