COMING SOON 🚀

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


;(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년 전 조회 2,923
11년 전 조회 3,249
11년 전 조회 2,489
11년 전 조회 2,641
11년 전 조회 2,597
11년 전 조회 2,720
11년 전 조회 3,258
11년 전 조회 2,831
11년 전 조회 2,830
11년 전 조회 7,318
11년 전 조회 2,885
11년 전 조회 2,997
11년 전 조회 3,037
11년 전 조회 3,169
11년 전 조회 3,544
11년 전 조회 5,147
11년 전 조회 3,545
11년 전 조회 2,341
11년 전 조회 2,140
11년 전 조회 2,276
11년 전 조회 2,363
11년 전 조회 2,627
11년 전 조회 1.7만
11년 전 조회 2,748
11년 전 조회 1,861
11년 전 조회 1,907
11년 전 조회 2,161
11년 전 조회 4,462
11년 전 조회 2,235
11년 전 조회 2,015
11년 전 조회 2,059
11년 전 조회 1,930
11년 전 조회 2,113
11년 전 조회 2,902
11년 전 조회 1,867
11년 전 조회 2,269
11년 전 조회 2,933
11년 전 조회 1,802
11년 전 조회 2,653
11년 전 조회 1,990
11년 전 조회 2,132
11년 전 조회 2,603
11년 전 조회 2,887
11년 전 조회 1,825
11년 전 조회 2,407
11년 전 조회 1,762
11년 전 조회 4,939
11년 전 조회 2,350
11년 전 조회 2,602
11년 전 조회 2,387
11년 전 조회 1,828
11년 전 조회 1,963
11년 전 조회 1,850
11년 전 조회 6,336
11년 전 조회 1,828
11년 전 조회 1,818
11년 전 조회 4,264
11년 전 조회 2,124
11년 전 조회 5,683
11년 전 조회 3,058
11년 전 조회 3,863
11년 전 조회 1,802
11년 전 조회 1,816
11년 전 조회 2,672
11년 전 조회 1,875
11년 전 조회 2,814
11년 전 조회 2,762
11년 전 조회 5,673
11년 전 조회 2,162
11년 전 조회 3,298
11년 전 조회 2,571
11년 전 조회 2,624
11년 전 조회 2,713
11년 전 조회 1,958
11년 전 조회 2,768
11년 전 조회 1,659
11년 전 조회 4,943
11년 전 조회 3,010
11년 전 조회 2,841
11년 전 조회 2,475
11년 전 조회 7,974
11년 전 조회 2,411
11년 전 조회 2,048
11년 전 조회 3,516
11년 전 조회 2,844
11년 전 조회 1,967
12년 전 조회 2,372
12년 전 조회 3,707
12년 전 조회 3,111
12년 전 조회 2,920
12년 전 조회 3,222
12년 전 조회 3,514
12년 전 조회 4,265
12년 전 조회 3,858
12년 전 조회 3,908
12년 전 조회 4,616
12년 전 조회 4,400
12년 전 조회 1,809
12년 전 조회 5,296
12년 전 조회 6,357