;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 630 | 19년 전 | 2332 | ||
| 629 |
|
19년 전 | 1998 | |
| 628 |
|
19년 전 | 3096 | |
| 627 |
|
19년 전 | 2010 | |
| 626 |
|
19년 전 | 2048 | |
| 625 |
|
19년 전 | 1703 | |
| 624 |
|
19년 전 | 2208 | |
| 623 | 19년 전 | 2184 | ||
| 622 |
|
19년 전 | 2486 | |
| 621 |
|
19년 전 | 2877 | |
| 620 |
|
19년 전 | 2384 | |
| 619 | 19년 전 | 2447 | ||
| 618 | 19년 전 | 3503 | ||
| 617 |
|
19년 전 | 3218 | |
| 616 |
|
19년 전 | 3205 | |
| 615 |
|
19년 전 | 3019 | |
| 614 |
|
19년 전 | 2027 | |
| 613 |
|
19년 전 | 2347 | |
| 612 |
|
19년 전 | 2226 | |
| 611 |
|
19년 전 | 2062 | |
| 610 |
|
19년 전 | 2501 | |
| 609 |
|
19년 전 | 2410 | |
| 608 |
|
19년 전 | 2800 | |
| 607 | 19년 전 | 2176 | ||
| 606 | 19년 전 | 3499 | ||
| 605 | 19년 전 | 1968 | ||
| 604 | 19년 전 | 2572 | ||
| 603 | 19년 전 | 1600 | ||
| 602 |
|
19년 전 | 2827 | |
| 601 | 19년 전 | 3067 | ||
| 600 |
|
19년 전 | 2152 | |
| 599 | 19년 전 | 1991 | ||
| 598 | 19년 전 | 2464 | ||
| 597 | 19년 전 | 2378 | ||
| 596 |
|
19년 전 | 3067 | |
| 595 |
|
19년 전 | 6744 | |
| 594 | 19년 전 | 2703 | ||
| 593 | 19년 전 | 3178 | ||
| 592 |
|
19년 전 | 3076 | |
| 591 |
|
19년 전 | 1917 | |
| 590 | 19년 전 | 3357 | ||
| 589 | 19년 전 | 2187 | ||
| 588 |
|
19년 전 | 2695 | |
| 587 | 19년 전 | 2337 | ||
| 586 |
|
19년 전 | 4351 | |
| 585 | 19년 전 | 2470 | ||
| 584 | 19년 전 | 2739 | ||
| 583 |
|
19년 전 | 3504 | |
| 582 |
|
19년 전 | 3706 | |
| 581 |
|
19년 전 | 3231 | |
| 580 | 19년 전 | 2470 | ||
| 579 | 19년 전 | 3042 | ||
| 578 | 19년 전 | 3910 | ||
| 577 | 19년 전 | 3784 | ||
| 576 | 19년 전 | 1718 | ||
| 575 |
|
19년 전 | 2189 | |
| 574 |
|
19년 전 | 5395 | |
| 573 | 19년 전 | 6698 | ||
| 572 | 19년 전 | 2551 | ||
| 571 | 19년 전 | 2101 | ||
| 570 | 19년 전 | 2593 | ||
| 569 | 19년 전 | 3261 | ||
| 568 | 19년 전 | 3503 | ||
| 567 | 19년 전 | 2975 | ||
| 566 | 19년 전 | 2586 | ||
| 565 |
|
19년 전 | 4699 | |
| 564 |
|
19년 전 | 6706 | |
| 563 |
|
19년 전 | 4971 | |
| 562 |
|
19년 전 | 5934 | |
| 561 |
|
19년 전 | 2672 | |
| 560 |
|
19년 전 | 2493 | |
| 559 |
|
19년 전 | 2202 | |
| 558 |
|
19년 전 | 2287 | |
| 557 | 19년 전 | 4582 | ||
| 556 |
|
19년 전 | 4644 | |
| 555 | 19년 전 | 2489 | ||
| 554 | 19년 전 | 2167 | ||
| 553 | 19년 전 | 2498 | ||
| 552 |
|
19년 전 | 3134 | |
| 551 | 19년 전 | 2924 | ||
| 550 |
|
19년 전 | 1883 | |
| 549 |
|
19년 전 | 1944 | |
| 548 |
|
19년 전 | 3134 | |
| 547 |
|
19년 전 | 2354 | |
| 546 |
|
19년 전 | 3609 | |
| 545 |
|
19년 전 | 2534 | |
| 544 |
|
19년 전 | 1839 | |
| 543 |
|
19년 전 | 2444 | |
| 542 |
|
19년 전 | 1710 | |
| 541 |
|
19년 전 | 1392 | |
| 540 |
|
19년 전 | 1522 | |
| 539 |
|
19년 전 | 1790 | |
| 538 |
|
19년 전 | 1566 | |
| 537 |
|
19년 전 | 1765 | |
| 536 |
|
19년 전 | 1553 | |
| 535 |
|
19년 전 | 1944 | |
| 534 |
|
19년 전 | 1832 | |
| 533 |
|
19년 전 | 1430 | |
| 532 |
|
19년 전 | 1432 | |
| 531 |
|
19년 전 | 1346 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기