;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6430 | 12년 전 | 985 | ||
| 6429 | 12년 전 | 9106 | ||
| 6428 | 12년 전 | 606 | ||
| 6427 |
제이티37
|
12년 전 | 1571 | |
| 6426 |
프로프리랜서
|
12년 전 | 1157 | |
| 6425 |
프로프리랜서
|
12년 전 | 1611 | |
| 6424 |
프로프리랜서
|
12년 전 | 1815 | |
| 6423 | 12년 전 | 1003 | ||
| 6422 |
퍼블리셔지노군
|
12년 전 | 1577 | |
| 6421 | 12년 전 | 2211 | ||
| 6420 |
|
12년 전 | 1334 | |
| 6419 |
|
12년 전 | 1287 | |
| 6418 | 12년 전 | 1186 | ||
| 6417 |
senseme
|
12년 전 | 7428 | |
| 6416 |
senseme
|
12년 전 | 1331 | |
| 6415 |
senseme
|
12년 전 | 1193 | |
| 6414 |
senseme
|
12년 전 | 1971 | |
| 6413 |
senseme
|
12년 전 | 977 | |
| 6412 |
senseme
|
12년 전 | 1494 | |
| 6411 |
senseme
|
12년 전 | 1106 | |
| 6410 |
senseme
|
12년 전 | 1049 | |
| 6409 |
PASKRAN
|
12년 전 | 2819 | |
| 6408 | 12년 전 | 10805 | ||
| 6407 | 12년 전 | 2993 | ||
| 6406 |
프로프리랜서
|
12년 전 | 2837 | |
| 6405 |
프로프리랜서
|
12년 전 | 1375 | |
| 6404 |
프로프리랜서
|
12년 전 | 2726 | |
| 6403 |
프로프리랜서
|
12년 전 | 822 | |
| 6402 |
프로프리랜서
|
12년 전 | 1736 | |
| 6401 |
프로프리랜서
|
12년 전 | 1141 | |
| 6400 |
프로프리랜서
|
12년 전 | 1472 | |
| 6399 |
프로프리랜서
|
12년 전 | 1182 | |
| 6398 |
프로프리랜서
|
12년 전 | 1496 | |
| 6397 |
프로프리랜서
|
12년 전 | 3606 | |
| 6396 | 12년 전 | 1874 | ||
| 6395 | 12년 전 | 922 | ||
| 6394 |
|
12년 전 | 5241 | |
| 6393 |
제이티37
|
12년 전 | 1206 | |
| 6392 |
songsinica
|
12년 전 | 1213 | |
| 6391 |
|
12년 전 | 3396 | |
| 6390 |
|
12년 전 | 1627 | |
| 6389 | 12년 전 | 4861 | ||
| 6388 |
스누피사랑
|
12년 전 | 5434 | |
| 6387 | 12년 전 | 1839 | ||
| 6386 | 12년 전 | 3063 | ||
| 6385 |
희망과열정
|
12년 전 | 929 | |
| 6384 | 12년 전 | 3295 | ||
| 6383 | 12년 전 | 10601 | ||
| 6382 |
|
12년 전 | 5791 | |
| 6381 |
SugarSkull
|
12년 전 | 1032 | |
| 6380 | 12년 전 | 782 | ||
| 6379 |
|
12년 전 | 1984 | |
| 6378 | 12년 전 | 1566 | ||
| 6377 | 12년 전 | 500 | ||
| 6376 |
후라보노보노
|
12년 전 | 1335 | |
| 6375 | 12년 전 | 2874 | ||
| 6374 | 12년 전 | 842 | ||
| 6373 | 12년 전 | 2371 | ||
| 6372 |
takumi22
|
12년 전 | 1242 | |
| 6371 |
개초보제이
|
12년 전 | 779 | |
| 6370 |
고급자가되고
|
12년 전 | 1464 | |
| 6369 | 12년 전 | 889 | ||
| 6368 | 12년 전 | 3188 | ||
| 6367 | 12년 전 | 1883 | ||
| 6366 | 12년 전 | 2886 | ||
| 6365 |
lilyosia
|
12년 전 | 1799 | |
| 6364 | 12년 전 | 1061 | ||
| 6363 | 12년 전 | 1595 | ||
| 6362 | 12년 전 | 2740 | ||
| 6361 | 12년 전 | 2564 | ||
| 6360 | 12년 전 | 1011 | ||
| 6359 | 12년 전 | 2105 | ||
| 6358 |
|
12년 전 | 1793 | |
| 6357 |
에헤라디야자진방아를돌려라
|
12년 전 | 789 | |
| 6356 | 12년 전 | 2093 | ||
| 6355 | 12년 전 | 3789 | ||
| 6354 | 12년 전 | 3104 | ||
| 6353 | 12년 전 | 1548 | ||
| 6352 | 12년 전 | 7772 | ||
| 6351 | 12년 전 | 2540 | ||
| 6350 | 12년 전 | 2801 | ||
| 6349 | 12년 전 | 1882 | ||
| 6348 | 12년 전 | 3551 | ||
| 6347 | 12년 전 | 1450 | ||
| 6346 | 12년 전 | 1195 | ||
| 6345 | 12년 전 | 1835 | ||
| 6344 | 12년 전 | 1416 | ||
| 6343 |
프로프리랜서
|
12년 전 | 2060 | |
| 6342 |
프로프리랜서
|
12년 전 | 1391 | |
| 6341 |
프로프리랜서
|
12년 전 | 1814 | |
| 6340 |
프로프리랜서
|
12년 전 | 1907 | |
| 6339 |
프로프리랜서
|
12년 전 | 1348 | |
| 6338 |
프로프리랜서
|
12년 전 | 1619 | |
| 6337 | 12년 전 | 5276 | ||
| 6336 |
프로프리랜서
|
12년 전 | 1634 | |
| 6335 |
프로프리랜서
|
12년 전 | 952 | |
| 6334 |
프로프리랜서
|
12년 전 | 1331 | |
| 6333 |
프로프리랜서
|
12년 전 | 2444 | |
| 6332 | 12년 전 | 1102 | ||
| 6331 |
돗단배123
|
12년 전 | 1423 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기