;(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);
.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);
})
})
.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);
});
clicklink(0);
});
$('.int>#sol01').click(function(){
clicklink(3);
});
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개
HackYa
11년 전
if statement 만 하나 넣어주시면 되잖아요.
if (screen.width >= 1024) {
메뉴실행
}
아니면 서버쪽에서 (php 에서) 브라우져 agent detect 하셔서 데스크탑인 경우에만 위 jQuery 를 load 하게 하셔도 되고.
if (screen.width >= 1024) {
메뉴실행
}
아니면 서버쪽에서 (php 에서) 브라우져 agent detect 하셔서 데스크탑인 경우에만 위 jQuery 를 load 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6030 | 12년 전 | 2831 | ||
| 6029 | 12년 전 | 2853 | ||
| 6028 | 12년 전 | 1476 | ||
| 6027 | 12년 전 | 898 | ||
| 6026 |
kiplayer
|
12년 전 | 810 | |
| 6025 | 12년 전 | 610 | ||
| 6024 | 12년 전 | 2826 | ||
| 6023 | 12년 전 | 2959 | ||
| 6022 |
|
12년 전 | 2114 | |
| 6021 |
Holyreign
|
12년 전 | 1344 | |
| 6020 | 12년 전 | 792 | ||
| 6019 | 12년 전 | 2864 | ||
| 6018 | 12년 전 | 3200 | ||
| 6017 | 12년 전 | 1245 | ||
| 6016 |
kiplayer
|
12년 전 | 10587 | |
| 6015 |
itlang
|
12년 전 | 1427 | |
| 6014 | 12년 전 | 430 | ||
| 6013 |
senseme
|
12년 전 | 1367 | |
| 6012 | 12년 전 | 3115 | ||
| 6011 | 12년 전 | 7132 | ||
| 6010 | 12년 전 | 8968 | ||
| 6009 | 12년 전 | 2876 | ||
| 6008 | 12년 전 | 2998 | ||
| 6007 | 12년 전 | 6680 | ||
| 6006 | 12년 전 | 10519 | ||
| 6005 | 12년 전 | 4056 | ||
| 6004 |
|
12년 전 | 589 | |
| 6003 | 12년 전 | 892 | ||
| 6002 | 12년 전 | 2355 | ||
| 6001 | 12년 전 | 691 | ||
| 6000 |
kiplayer
|
12년 전 | 3743 | |
| 5999 | 12년 전 | 443 | ||
| 5998 |
|
12년 전 | 2948 | |
| 5997 |
|
12년 전 | 3445 | |
| 5996 | 12년 전 | 2103 | ||
| 5995 |
kiplayer
|
12년 전 | 2179 | |
| 5994 |
|
12년 전 | 3275 | |
| 5993 |
windowhan
|
12년 전 | 683 | |
| 5992 | 12년 전 | 2905 | ||
| 5991 | 12년 전 | 5240 | ||
| 5990 | 12년 전 | 1644 | ||
| 5989 |
AMDbest
|
12년 전 | 1356 | |
| 5988 | 12년 전 | 1221 | ||
| 5987 |
kiplayer
|
12년 전 | 1139 | |
| 5986 |
한번잘해보자
|
12년 전 | 930 | |
| 5985 |
kiplayer
|
12년 전 | 3143 | |
| 5984 |
dsv421
|
12년 전 | 810 | |
| 5983 |
dsv421
|
12년 전 | 1511 | |
| 5982 |
dsv421
|
12년 전 | 5843 | |
| 5981 | 12년 전 | 3220 | ||
| 5980 |
MFBob
|
12년 전 | 2629 | |
| 5979 | 12년 전 | 3103 | ||
| 5978 |
AMDbest
|
12년 전 | 1463 | |
| 5977 | 12년 전 | 795 | ||
| 5976 | 12년 전 | 1214 | ||
| 5975 | 12년 전 | 1280 | ||
| 5974 | 12년 전 | 616 | ||
| 5973 |
kiplayer
|
12년 전 | 3558 | |
| 5972 |
kiplayer
|
12년 전 | 3983 | |
| 5971 |
kiplayer
|
12년 전 | 2306 | |
| 5970 |
kiplayer
|
12년 전 | 8297 | |
| 5969 |
kiplayer
|
12년 전 | 952 | |
| 5968 | 12년 전 | 8748 | ||
| 5967 |
|
12년 전 | 16906 | |
| 5966 | 12년 전 | 1233 | ||
| 5965 | 12년 전 | 712 | ||
| 5964 | 12년 전 | 6254 | ||
| 5963 | 12년 전 | 709 | ||
| 5962 | 12년 전 | 888 | ||
| 5961 | 12년 전 | 642 | ||
| 5960 | 12년 전 | 787 | ||
| 5959 |
|
12년 전 | 1124 | |
| 5958 | 12년 전 | 986 | ||
| 5957 |
웹디자인되고파
|
12년 전 | 1093 | |
| 5956 | 12년 전 | 3661 | ||
| 5955 | 12년 전 | 2143 | ||
| 5954 | 12년 전 | 4401 | ||
| 5953 | 12년 전 | 3092 | ||
| 5952 | 12년 전 | 4270 | ||
| 5951 | 12년 전 | 2084 | ||
| 5950 | 12년 전 | 1284 | ||
| 5949 | 12년 전 | 940 | ||
| 5948 | 12년 전 | 2086 | ||
| 5947 | 12년 전 | 5005 | ||
| 5946 |
dsv421
|
12년 전 | 1276 | |
| 5945 |
dsv421
|
12년 전 | 4124 | |
| 5944 |
dsv421
|
12년 전 | 5646 | |
| 5943 | 12년 전 | 1292 | ||
| 5942 | 12년 전 | 2542 | ||
| 5941 |
프로프리랜서
|
12년 전 | 1647 | |
| 5940 |
atria
|
12년 전 | 620 | |
| 5939 | 12년 전 | 2346 | ||
| 5938 | 12년 전 | 2089 | ||
| 5937 |
프로프리랜서
|
12년 전 | 779 | |
| 5936 |
프로프리랜서
|
12년 전 | 716 | |
| 5935 |
프로프리랜서
|
12년 전 | 3220 | |
| 5934 |
프로프리랜서
|
12년 전 | 1646 | |
| 5933 |
AMDbest
|
12년 전 | 662 | |
| 5932 |
AMDbest
|
12년 전 | 507 | |
| 5931 | 12년 전 | 8144 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기