;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7830 | 10년 전 | 472 | ||
| 7829 |
|
10년 전 | 661 | |
| 7828 | 10년 전 | 585 | ||
| 7827 | 10년 전 | 484 | ||
| 7826 | 10년 전 | 505 | ||
| 7825 | 10년 전 | 544 | ||
| 7824 | 10년 전 | 497 | ||
| 7823 | 10년 전 | 435 | ||
| 7822 | 10년 전 | 409 | ||
| 7821 | 10년 전 | 361 | ||
| 7820 | 10년 전 | 372 | ||
| 7819 |
|
10년 전 | 773 | |
| 7818 | 10년 전 | 435 | ||
| 7817 | 10년 전 | 614 | ||
| 7816 | 10년 전 | 453 | ||
| 7815 | 10년 전 | 655 | ||
| 7814 | 10년 전 | 488 | ||
| 7813 | 10년 전 | 440 | ||
| 7812 | 10년 전 | 450 | ||
| 7811 | 10년 전 | 428 | ||
| 7810 | 10년 전 | 631 | ||
| 7809 | 10년 전 | 565 | ||
| 7808 | 10년 전 | 444 | ||
| 7807 | 10년 전 | 455 | ||
| 7806 |
프로그래머7
|
10년 전 | 1373 | |
| 7805 | 10년 전 | 1319 | ||
| 7804 |
zahir1312
|
10년 전 | 813 | |
| 7803 |
|
10년 전 | 1419 | |
| 7802 | 10년 전 | 518 | ||
| 7801 | 10년 전 | 895 | ||
| 7800 | 10년 전 | 1115 | ||
| 7799 | 10년 전 | 597 | ||
| 7798 | 10년 전 | 544 | ||
| 7797 | 10년 전 | 572 | ||
| 7796 | 10년 전 | 404 | ||
| 7795 | 10년 전 | 556 | ||
| 7794 | 10년 전 | 595 | ||
| 7793 | 10년 전 | 1097 | ||
| 7792 | 10년 전 | 525 | ||
| 7791 | 10년 전 | 616 | ||
| 7790 | 10년 전 | 550 | ||
| 7789 |
fbastore
|
10년 전 | 1498 | |
| 7788 | 10년 전 | 602 | ||
| 7787 | 10년 전 | 462 | ||
| 7786 | 10년 전 | 665 | ||
| 7785 | 10년 전 | 642 | ||
| 7784 | 10년 전 | 699 | ||
| 7783 | 10년 전 | 519 | ||
| 7782 | 10년 전 | 544 | ||
| 7781 | 10년 전 | 949 | ||
| 7780 | 10년 전 | 853 | ||
| 7779 | 10년 전 | 804 | ||
| 7778 | 10년 전 | 397 | ||
| 7777 | 10년 전 | 512 | ||
| 7776 | 10년 전 | 506 | ||
| 7775 | 10년 전 | 441 | ||
| 7774 | 10년 전 | 654 | ||
| 7773 | 10년 전 | 412 | ||
| 7772 | 10년 전 | 789 | ||
| 7771 | 10년 전 | 440 | ||
| 7770 | 10년 전 | 681 | ||
| 7769 | 10년 전 | 440 | ||
| 7768 | 10년 전 | 661 | ||
| 7767 | 10년 전 | 1215 | ||
| 7766 | 10년 전 | 547 | ||
| 7765 | 10년 전 | 607 | ||
| 7764 |
잘살아보자
|
10년 전 | 460 | |
| 7763 |
|
10년 전 | 1510 | |
| 7762 |
Tosea
|
10년 전 | 1093 | |
| 7761 | 10년 전 | 711 | ||
| 7760 |
잘살아보자
|
10년 전 | 777 | |
| 7759 |
잘살아보자
|
10년 전 | 616 | |
| 7758 |
잘살아보자
|
10년 전 | 678 | |
| 7757 | 10년 전 | 1304 | ||
| 7756 |
ITBANK
|
10년 전 | 1304 | |
| 7755 | 10년 전 | 1956 | ||
| 7754 | 10년 전 | 1111 | ||
| 7753 | 10년 전 | 930 | ||
| 7752 | 10년 전 | 1429 | ||
| 7751 |
잘살아보자
|
10년 전 | 592 | |
| 7750 |
잘살아보자
|
10년 전 | 527 | |
| 7749 |
잘살아보자
|
10년 전 | 549 | |
| 7748 |
잘살아보자
|
10년 전 | 571 | |
| 7747 |
잘살아보자
|
10년 전 | 645 | |
| 7746 |
잘살아보자
|
10년 전 | 708 | |
| 7745 |
잘살아보자
|
10년 전 | 957 | |
| 7744 |
잘살아보자
|
10년 전 | 448 | |
| 7743 | 10년 전 | 978 | ||
| 7742 |
starbros
|
10년 전 | 873 | |
| 7741 |
잘살아보자
|
10년 전 | 716 | |
| 7740 |
잘살아보자
|
10년 전 | 606 | |
| 7739 |
잘살아보자
|
10년 전 | 498 | |
| 7738 |
잘살아보자
|
10년 전 | 572 | |
| 7737 |
잘살아보자
|
10년 전 | 551 | |
| 7736 |
잘살아보자
|
10년 전 | 570 | |
| 7735 |
잘살아보자
|
10년 전 | 903 | |
| 7734 |
잘살아보자
|
10년 전 | 460 | |
| 7733 |
잘살아보자
|
10년 전 | 572 | |
| 7732 |
잘살아보자
|
10년 전 | 738 | |
| 7731 |
잘살아보자
|
10년 전 | 660 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기