;(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년 전 | 2304 | ||
| 7129 | 11년 전 | 710 | ||
| 7128 |
senseme
|
11년 전 | 1299 | |
| 7127 | 11년 전 | 1173 | ||
| 7126 | 11년 전 | 823 | ||
| 7125 | 11년 전 | 2950 | ||
| 7124 | 11년 전 | 1426 | ||
| 7123 |
잘살아보자
|
11년 전 | 1291 | |
| 7122 |
잘살아보자
|
11년 전 | 689 | |
| 7121 |
잘살아보자
|
11년 전 | 3050 | |
| 7120 |
잘살아보자
|
11년 전 | 2918 | |
| 7119 |
잘살아보자
|
11년 전 | 732 | |
| 7118 |
잘살아보자
|
11년 전 | 3433 | |
| 7117 |
잘살아보자
|
11년 전 | 853 | |
| 7116 | 11년 전 | 746 | ||
| 7115 | 11년 전 | 1032 | ||
| 7114 | 11년 전 | 850 | ||
| 7113 | 11년 전 | 664 | ||
| 7112 | 11년 전 | 1086 | ||
| 7111 | 11년 전 | 1800 | ||
| 7110 | 11년 전 | 1035 | ||
| 7109 |
버섯먹은나
|
11년 전 | 811 | |
| 7108 | 11년 전 | 647 | ||
| 7107 | 11년 전 | 2409 | ||
| 7106 | 11년 전 | 1961 | ||
| 7105 | 11년 전 | 2485 | ||
| 7104 | 11년 전 | 1425 | ||
| 7103 |
|
11년 전 | 2709 | |
| 7102 | 11년 전 | 3119 | ||
| 7101 | 11년 전 | 4446 | ||
| 7100 | 11년 전 | 5794 | ||
| 7099 | 11년 전 | 2143 | ||
| 7098 | 11년 전 | 1725 | ||
| 7097 | 11년 전 | 1462 | ||
| 7096 | 11년 전 | 1128 | ||
| 7095 |
잘살아보자
|
11년 전 | 859 | |
| 7094 |
잘살아보자
|
11년 전 | 1063 | |
| 7093 |
잘살아보자
|
11년 전 | 940 | |
| 7092 |
잘살아보자
|
11년 전 | 1411 | |
| 7091 |
잘살아보자
|
11년 전 | 2212 | |
| 7090 |
잘살아보자
|
11년 전 | 894 | |
| 7089 | 11년 전 | 1067 | ||
| 7088 | 11년 전 | 1715 | ||
| 7087 | 11년 전 | 1411 | ||
| 7086 | 11년 전 | 1313 | ||
| 7085 |
|
11년 전 | 1237 | |
| 7084 | 11년 전 | 1156 | ||
| 7083 | 11년 전 | 3504 | ||
| 7082 | 11년 전 | 1154 | ||
| 7081 | 11년 전 | 1738 | ||
| 7080 | 11년 전 | 2025 | ||
| 7079 | 11년 전 | 1332 | ||
| 7078 | 11년 전 | 1305 | ||
| 7077 | 11년 전 | 1314 | ||
| 7076 | 11년 전 | 771 | ||
| 7075 | 11년 전 | 1155 | ||
| 7074 |
네이비칼라
|
11년 전 | 1509 | |
| 7073 | 11년 전 | 1479 | ||
| 7072 |
|
11년 전 | 836 | |
| 7071 | 11년 전 | 1210 | ||
| 7070 | 11년 전 | 935 | ||
| 7069 | 11년 전 | 1708 | ||
| 7068 | 11년 전 | 1363 | ||
| 7067 |
TPSint
|
11년 전 | 748 | |
| 7066 | 11년 전 | 2154 | ||
| 7065 | 11년 전 | 6652 | ||
| 7064 | 11년 전 | 1296 | ||
| 7063 | 11년 전 | 1140 | ||
| 7062 | 11년 전 | 1079 | ||
| 7061 | 11년 전 | 919 | ||
| 7060 | 11년 전 | 1474 | ||
| 7059 | 11년 전 | 885 | ||
| 7058 |
EngineMan
|
11년 전 | 3407 | |
| 7057 | 11년 전 | 1249 | ||
| 7056 | 11년 전 | 1639 | ||
| 7055 | 11년 전 | 1020 | ||
| 7054 | 11년 전 | 2658 | ||
| 7053 |
네이비칼라
|
11년 전 | 1289 | |
| 7052 | 11년 전 | 2584 | ||
| 7051 | 11년 전 | 1941 | ||
| 7050 | 11년 전 | 2457 | ||
| 7049 | 11년 전 | 1413 | ||
| 7048 | 11년 전 | 2538 | ||
| 7047 | 11년 전 | 1361 | ||
| 7046 | 11년 전 | 1042 | ||
| 7045 | 11년 전 | 1069 | ||
| 7044 | 11년 전 | 5440 | ||
| 7043 | 11년 전 | 1234 | ||
| 7042 | 11년 전 | 792 | ||
| 7041 |
열라뽕똬이
|
11년 전 | 762 | |
| 7040 | 11년 전 | 1118 | ||
| 7039 | 11년 전 | 1465 | ||
| 7038 | 11년 전 | 1879 | ||
| 7037 | 11년 전 | 2182 | ||
| 7036 | 11년 전 | 1089 | ||
| 7035 | 11년 전 | 1410 | ||
| 7034 | 11년 전 | 1359 | ||
| 7033 |
열라뽕똬이
|
11년 전 | 1000 | |
| 7032 | 11년 전 | 755 | ||
| 7031 | 11년 전 | 2188 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기