제이쿼리 이부분 어떻게 수정해야할까요??


;(function($) {
 $.fn.gnbmenu = function(options) {
  options = $.extend({
   width:900,
   speed: 500,
   easing: 'easeOutCubic', 
   reset: 2000
  }, options);
  
  return this.each(function() {
   var $nav = $(this),
     $nav_gnb = $(this).find('li'),
     $gnb_img = $('.gnb_img p'),
     $current_item = $(this).find('.focus'),
     $index = 0, $focus_index = 0,
     $autoheight = $('.intro').outerHeight(),
     reset;
   $('#container').css('height',$autoheight);
   $nav_gnb.bind('mouseover focusin', function() {
    $index = $(this).index();
    clearTimeout(reset);
    $gnb_img.animate({
     left: $(this).position().left,
     width: $(this).outerWidth()
    }, {
     duration: options.speed,
     easing: options.easing,
     queue: false
    });
   })
   .bind('mouseover focusin', function() {
    reset = setTimeout(function() {
     $gnb_img.animate({
      left: $current_item.position().left,
      width: $current_item.outerWidth()     
     }, options.speed);
    }, options.reset);
   })
   .click(function(){
    $(this)
     .siblings().removeClass('focus')
     .end().addClass('focus');
    $current_item = $(this);    
    $focus_index = $(this).index();
    if($focus_index == 0){
     $('#wrap').addClass('none');
    }else{
     $('#wrap').removeClass('none');
    }
    $autoheight = $('.contents>div:eq('+ $focus_index +')').outerHeight();
    $('#container').stop().animate({'height':$autoheight},options.speed)
    $('.contents').stop().animate({'left':- options.width * $focus_index
    },options.speed,options.easing);
   })
   $('#header h1').click(function(){
    clicklink(0);
   });
   $('.int>#sol01').click(function(){
    clicklink(3);
   });
   
   
   function clicklink(a){
    $('.focus').removeClass('focus');
    if(a == 0){
     $('#wrap').addClass('none');
    }else{
     $('#wrap').removeClass('none');
    }
    $current_item = $nav.find('li:eq(' + a + ')').addClass('focus');
    $autoheight = $('.contents>div:eq(' + a + ')').outerHeight();
    $('.contents').stop().animate({'left':- options.width * a},options.speed);
    $('#container').stop().animate({'height':$autoheight},options.speed);
    clearTimeout(reset);
    reset = setTimeout(function() {
     $gnb_img.animate({
      left: $current_item.position().left,
      width: $current_item.outerWidth()     
     }, options.speed);
    }, 100);
   };
  });
 }
})(jQuery);

이 쿼리를 해상도가 1024이상일때만 (데스크탑) 실행되게 하려면 어떻게 소스를 수정해야할까요??
|

댓글 1개

if statement 만 하나 넣어주시면 되잖아요.

if (screen.width >= 1024) {
메뉴실행
}

아니면 서버쪽에서 (php 에서) 브라우져 agent detect 하셔서 데스크탑인 경우에만 위 jQuery 를 load 하게 하셔도 되고.
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
11년 전 조회 3,068
11년 전 조회 3,383
11년 전 조회 2,610
11년 전 조회 2,801
11년 전 조회 2,760
11년 전 조회 2,886
11년 전 조회 3,401
11년 전 조회 2,993
11년 전 조회 2,987
11년 전 조회 7,485
11년 전 조회 3,023
11년 전 조회 3,148
11년 전 조회 3,183
11년 전 조회 3,317
11년 전 조회 3,705
11년 전 조회 5,297
11년 전 조회 3,677
11년 전 조회 2,487
11년 전 조회 2,299
11년 전 조회 2,422
11년 전 조회 2,518
11년 전 조회 2,778
11년 전 조회 1.7만
11년 전 조회 2,859
11년 전 조회 2,017
11년 전 조회 2,074
11년 전 조회 2,328
11년 전 조회 4,604
11년 전 조회 2,382
11년 전 조회 2,158
11년 전 조회 2,218
11년 전 조회 2,074
11년 전 조회 2,234
11년 전 조회 3,013
11년 전 조회 2,005
11년 전 조회 2,403
11년 전 조회 3,066
11년 전 조회 1,939
11년 전 조회 2,764
11년 전 조회 2,113
11년 전 조회 2,253
11년 전 조회 2,735
11년 전 조회 3,018
11년 전 조회 1,951
11년 전 조회 2,554
11년 전 조회 1,902
11년 전 조회 5,043
11년 전 조회 2,485
11년 전 조회 2,721
11년 전 조회 2,514
11년 전 조회 1,965
11년 전 조회 2,084
11년 전 조회 1,980
11년 전 조회 6,478
11년 전 조회 1,965
11년 전 조회 1,951
11년 전 조회 4,389
11년 전 조회 2,259
11년 전 조회 5,801
11년 전 조회 3,178
11년 전 조회 3,997
11년 전 조회 1,931
11년 전 조회 1,939
12년 전 조회 2,785
12년 전 조회 1,986
12년 전 조회 2,927
12년 전 조회 2,889
12년 전 조회 5,811
12년 전 조회 2,287
12년 전 조회 3,427
12년 전 조회 2,688
12년 전 조회 2,749
12년 전 조회 2,818
12년 전 조회 2,063
12년 전 조회 2,904
12년 전 조회 1,763
12년 전 조회 5,061
12년 전 조회 3,119
12년 전 조회 2,952
12년 전 조회 2,575
12년 전 조회 8,084
12년 전 조회 2,528
12년 전 조회 2,157
12년 전 조회 3,622
12년 전 조회 2,948
12년 전 조회 2,073
12년 전 조회 2,454
12년 전 조회 3,814
12년 전 조회 3,221
12년 전 조회 3,049
12년 전 조회 3,334
12년 전 조회 3,619
12년 전 조회 4,372
12년 전 조회 3,949
12년 전 조회 4,038
12년 전 조회 4,733
12년 전 조회 4,509
12년 전 조회 1,897
12년 전 조회 5,401
12년 전 조회 6,460