2012-11-22 2 views

답변

0

(물론이 작동하지 않을 수 있습니다) : jQuery를
이 같이 로 -

나는 화면 픽셀의 크기보다 작은 경우 클래스 변경을 원 .
사용 워드 프레스에 대한 jQuery를 및 기타의 .js 파일을 포함하려면 this

jQuery(document).on('ready', function() { 
     jQuery(window).on('resize', function() { 
      /* Tablet Portrait size to standard 960 (devices and browsers) */ 
      if (jQuery(document).width() < 959 && jQuery(document).width() > 768) { 
       //change the attributes from the div #home_content (first parameter: the attribute, what it needs to be) 
       jQuery('#home_content').attr('class','sixteen columns'); 
       jQuery('#slider').attr('class','sixteen columns'); 

      } 
      else{ 
       //change it back to normal (how the class was) 
       jQuery('#home_content').attr('class','nine columns'); 
       jQuery('#slider').attr('class','nine columns'); 
      } 

      /* Mobile Landscape Size to Tablet Portrait (devices and browsers) */ 
      if(jQuery(document).width() < 767 && jQuery(document).width() > 480) { 
       //code 
      } 
      else{ 

      } 

      /* Mobile Landscape Size to Tablet Portrait (devices and browsers) */ 
      if(jQuery(document).width() < 479) { 
       //code 
      } 
      else{ 

      } 
     }).trigger('resize'); // Trigger resize handlers.  
    });//ready