;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7130 | 11년 전 | 2293 | ||
| 7129 | 11년 전 | 695 | ||
| 7128 |
senseme
|
11년 전 | 1261 | |
| 7127 | 11년 전 | 1143 | ||
| 7126 | 11년 전 | 793 | ||
| 7125 | 11년 전 | 2936 | ||
| 7124 | 11년 전 | 1409 | ||
| 7123 |
잘살아보자
|
11년 전 | 1269 | |
| 7122 |
잘살아보자
|
11년 전 | 666 | |
| 7121 |
잘살아보자
|
11년 전 | 2997 | |
| 7120 |
잘살아보자
|
11년 전 | 2890 | |
| 7119 |
잘살아보자
|
11년 전 | 716 | |
| 7118 |
잘살아보자
|
11년 전 | 3415 | |
| 7117 |
잘살아보자
|
11년 전 | 835 | |
| 7116 | 11년 전 | 720 | ||
| 7115 | 11년 전 | 1008 | ||
| 7114 | 11년 전 | 818 | ||
| 7113 | 11년 전 | 634 | ||
| 7112 | 11년 전 | 1056 | ||
| 7111 | 11년 전 | 1777 | ||
| 7110 | 11년 전 | 1011 | ||
| 7109 |
버섯먹은나
|
11년 전 | 772 | |
| 7108 | 11년 전 | 611 | ||
| 7107 | 11년 전 | 2385 | ||
| 7106 | 11년 전 | 1939 | ||
| 7105 | 11년 전 | 2472 | ||
| 7104 | 11년 전 | 1403 | ||
| 7103 |
|
11년 전 | 2676 | |
| 7102 | 11년 전 | 3098 | ||
| 7101 | 11년 전 | 4427 | ||
| 7100 | 11년 전 | 5778 | ||
| 7099 | 11년 전 | 2121 | ||
| 7098 | 11년 전 | 1697 | ||
| 7097 | 11년 전 | 1436 | ||
| 7096 | 11년 전 | 1102 | ||
| 7095 |
잘살아보자
|
11년 전 | 840 | |
| 7094 |
잘살아보자
|
11년 전 | 1030 | |
| 7093 |
잘살아보자
|
11년 전 | 909 | |
| 7092 |
잘살아보자
|
11년 전 | 1393 | |
| 7091 |
잘살아보자
|
11년 전 | 2190 | |
| 7090 |
잘살아보자
|
11년 전 | 864 | |
| 7089 | 11년 전 | 1043 | ||
| 7088 | 11년 전 | 1700 | ||
| 7087 | 11년 전 | 1392 | ||
| 7086 | 11년 전 | 1280 | ||
| 7085 |
|
11년 전 | 1208 | |
| 7084 | 11년 전 | 1130 | ||
| 7083 | 11년 전 | 3480 | ||
| 7082 | 11년 전 | 1125 | ||
| 7081 | 11년 전 | 1723 | ||
| 7080 | 11년 전 | 1996 | ||
| 7079 | 11년 전 | 1303 | ||
| 7078 | 11년 전 | 1284 | ||
| 7077 | 11년 전 | 1275 | ||
| 7076 | 11년 전 | 740 | ||
| 7075 | 11년 전 | 1141 | ||
| 7074 |
네이비칼라
|
11년 전 | 1486 | |
| 7073 | 11년 전 | 1452 | ||
| 7072 |
|
11년 전 | 822 | |
| 7071 | 11년 전 | 1168 | ||
| 7070 | 11년 전 | 924 | ||
| 7069 | 11년 전 | 1681 | ||
| 7068 | 11년 전 | 1322 | ||
| 7067 |
TPSint
|
11년 전 | 701 | |
| 7066 | 11년 전 | 2137 | ||
| 7065 | 11년 전 | 6620 | ||
| 7064 | 11년 전 | 1276 | ||
| 7063 | 11년 전 | 1121 | ||
| 7062 | 11년 전 | 1052 | ||
| 7061 | 11년 전 | 897 | ||
| 7060 | 11년 전 | 1434 | ||
| 7059 | 11년 전 | 833 | ||
| 7058 |
EngineMan
|
11년 전 | 3386 | |
| 7057 | 11년 전 | 1232 | ||
| 7056 | 11년 전 | 1628 | ||
| 7055 | 11년 전 | 996 | ||
| 7054 | 11년 전 | 2631 | ||
| 7053 |
네이비칼라
|
11년 전 | 1270 | |
| 7052 | 11년 전 | 2557 | ||
| 7051 | 11년 전 | 1922 | ||
| 7050 | 11년 전 | 2438 | ||
| 7049 | 11년 전 | 1377 | ||
| 7048 | 11년 전 | 2512 | ||
| 7047 | 11년 전 | 1329 | ||
| 7046 | 11년 전 | 1012 | ||
| 7045 | 11년 전 | 1037 | ||
| 7044 | 11년 전 | 5425 | ||
| 7043 | 11년 전 | 1209 | ||
| 7042 | 11년 전 | 767 | ||
| 7041 |
열라뽕똬이
|
11년 전 | 743 | |
| 7040 | 11년 전 | 1093 | ||
| 7039 | 11년 전 | 1439 | ||
| 7038 | 11년 전 | 1856 | ||
| 7037 | 11년 전 | 2164 | ||
| 7036 | 11년 전 | 1073 | ||
| 7035 | 11년 전 | 1392 | ||
| 7034 | 11년 전 | 1335 | ||
| 7033 |
열라뽕똬이
|
11년 전 | 983 | |
| 7032 | 11년 전 | 736 | ||
| 7031 | 11년 전 | 2168 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기