;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6230 |
senseme
|
12년 전 | 1058 | |
| 6229 |
senseme
|
12년 전 | 1079 | |
| 6228 | 12년 전 | 4441 | ||
| 6227 |
senseme
|
12년 전 | 1497 | |
| 6226 |
senseme
|
12년 전 | 1644 | |
| 6225 | 12년 전 | 5500 | ||
| 6224 | 12년 전 | 3271 | ||
| 6223 |
kiplayer
|
12년 전 | 2142 | |
| 6222 | 12년 전 | 1303 | ||
| 6221 | 12년 전 | 3496 | ||
| 6220 | 12년 전 | 2517 | ||
| 6219 | 12년 전 | 2230 | ||
| 6218 |
senseme
|
12년 전 | 1843 | |
| 6217 |
senseme
|
12년 전 | 1534 | |
| 6216 |
senseme
|
12년 전 | 1530 | |
| 6215 |
senseme
|
12년 전 | 1283 | |
| 6214 | 12년 전 | 2399 | ||
| 6213 |
senseme
|
12년 전 | 1673 | |
| 6212 |
senseme
|
12년 전 | 1349 | |
| 6211 |
senseme
|
12년 전 | 2436 | |
| 6210 |
senseme
|
12년 전 | 1617 | |
| 6209 | 12년 전 | 2221 | ||
| 6208 | 12년 전 | 3446 | ||
| 6207 | 12년 전 | 1227 | ||
| 6206 |
senseme
|
12년 전 | 2198 | |
| 6205 | 12년 전 | 1042 | ||
| 6204 |
kiplayer
|
12년 전 | 1528 | |
| 6203 |
senseme
|
12년 전 | 2129 | |
| 6202 |
senseme
|
12년 전 | 1755 | |
| 6201 |
senseme
|
12년 전 | 4571 | |
| 6200 |
senseme
|
12년 전 | 2671 | |
| 6199 |
senseme
|
12년 전 | 2835 | |
| 6198 |
senseme
|
12년 전 | 1240 | |
| 6197 |
senseme
|
12년 전 | 8558 | |
| 6196 |
senseme
|
12년 전 | 3346 | |
| 6195 | 12년 전 | 1435 | ||
| 6194 |
|
12년 전 | 1291 | |
| 6193 |
senseme
|
12년 전 | 2695 | |
| 6192 |
senseme
|
12년 전 | 5367 | |
| 6191 |
senseme
|
12년 전 | 3418 | |
| 6190 | 12년 전 | 1344 | ||
| 6189 | 12년 전 | 13501 | ||
| 6188 |
웹디자인되고파
|
12년 전 | 1208 | |
| 6187 | 12년 전 | 627 | ||
| 6186 | 12년 전 | 3937 | ||
| 6185 | 12년 전 | 1475 | ||
| 6184 | 12년 전 | 9384 | ||
| 6183 | 12년 전 | 796 | ||
| 6182 |
senseme
|
12년 전 | 1240 | |
| 6181 |
senseme
|
12년 전 | 3227 | |
| 6180 |
senseme
|
12년 전 | 856 | |
| 6179 |
senseme
|
12년 전 | 1768 | |
| 6178 | 12년 전 | 3633 | ||
| 6177 | 12년 전 | 1065 | ||
| 6176 | 12년 전 | 957 | ||
| 6175 |
senseme
|
12년 전 | 5303 | |
| 6174 |
senseme
|
12년 전 | 1430 | |
| 6173 |
senseme
|
12년 전 | 752 | |
| 6172 |
senseme
|
12년 전 | 2745 | |
| 6171 |
senseme
|
12년 전 | 2490 | |
| 6170 |
senseme
|
12년 전 | 1507 | |
| 6169 |
senseme
|
12년 전 | 2931 | |
| 6168 |
senseme
|
12년 전 | 6536 | |
| 6167 | 12년 전 | 2140 | ||
| 6166 | 12년 전 | 747 | ||
| 6165 |
페이지팩트
|
12년 전 | 1910 | |
| 6164 |
네오soft
|
12년 전 | 1860 | |
| 6163 |
|
12년 전 | 2606 | |
| 6162 | 12년 전 | 592 | ||
| 6161 |
|
12년 전 | 1694 | |
| 6160 | 12년 전 | 773 | ||
| 6159 | 12년 전 | 1777 | ||
| 6158 |
|
12년 전 | 2682 | |
| 6157 |
sa2pan
|
12년 전 | 1247 | |
| 6156 | 12년 전 | 3893 | ||
| 6155 | 12년 전 | 9968 | ||
| 6154 | 12년 전 | 1126 | ||
| 6153 | 12년 전 | 2454 | ||
| 6152 |
생각보다몸이앞서다
|
12년 전 | 2126 | |
| 6151 | 12년 전 | 2977 | ||
| 6150 |
kiplayer
|
12년 전 | 6009 | |
| 6149 |
|
12년 전 | 2648 | |
| 6148 | 12년 전 | 2973 | ||
| 6147 |
hwang007
|
12년 전 | 953 | |
| 6146 |
aqqasdf
|
12년 전 | 770 | |
| 6145 | 12년 전 | 1863 | ||
| 6144 | 12년 전 | 5880 | ||
| 6143 |
smwkd
|
12년 전 | 1466 | |
| 6142 | 12년 전 | 4703 | ||
| 6141 | 12년 전 | 930 | ||
| 6140 | 12년 전 | 4099 | ||
| 6139 | 12년 전 | 1243 | ||
| 6138 | 12년 전 | 1097 | ||
| 6137 |
SugarSkull
|
12년 전 | 1682 | |
| 6136 | 12년 전 | 1312 | ||
| 6135 |
한번잘해보자
|
12년 전 | 562 | |
| 6134 |
프리랜서개발자
|
12년 전 | 541 | |
| 6133 |
basaria
|
12년 전 | 20445 | |
| 6132 | 12년 전 | 509 | ||
| 6131 | 12년 전 | 1086 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기