;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6730 |
|
11년 전 | 1106 | |
| 6729 | 11년 전 | 562 | ||
| 6728 |
|
11년 전 | 575 | |
| 6727 | 11년 전 | 2424 | ||
| 6726 | 11년 전 | 597 | ||
| 6725 |
네모웹에이전시
|
11년 전 | 437 | |
| 6724 |
네모웹에이전시
|
11년 전 | 884 | |
| 6723 | 11년 전 | 1018 | ||
| 6722 | 11년 전 | 960 | ||
| 6721 | 11년 전 | 644 | ||
| 6720 | 11년 전 | 1974 | ||
| 6719 | 11년 전 | 2196 | ||
| 6718 | 11년 전 | 1095 | ||
| 6717 |
|
11년 전 | 653 | |
| 6716 | 11년 전 | 2311 | ||
| 6715 | 11년 전 | 7579 | ||
| 6714 | 11년 전 | 2044 | ||
| 6713 | 11년 전 | 775 | ||
| 6712 |
geektoo
|
11년 전 | 1156 | |
| 6711 | 11년 전 | 896 | ||
| 6710 |
sirzzang
|
11년 전 | 2126 | |
| 6709 |
bewitched
|
11년 전 | 1800 | |
| 6708 |
levin
|
11년 전 | 565 | |
| 6707 | 11년 전 | 768 | ||
| 6706 | 11년 전 | 1789 | ||
| 6705 | 11년 전 | 987 | ||
| 6704 |
|
11년 전 | 752 | |
| 6703 | 11년 전 | 415 | ||
| 6702 | 11년 전 | 1094 | ||
| 6701 | 11년 전 | 804 | ||
| 6700 | 11년 전 | 1719 | ||
| 6699 | 11년 전 | 715 | ||
| 6698 |
이박사친구
|
11년 전 | 726 | |
| 6697 | 11년 전 | 1218 | ||
| 6696 | 11년 전 | 618 | ||
| 6695 |
Header
|
11년 전 | 705 | |
| 6694 | 11년 전 | 1160 | ||
| 6693 |
|
11년 전 | 1106 | |
| 6692 | 11년 전 | 1145 | ||
| 6691 | 11년 전 | 1287 | ||
| 6690 |
|
11년 전 | 715 | |
| 6689 | 11년 전 | 895 | ||
| 6688 | 11년 전 | 930 | ||
| 6687 | 11년 전 | 531 | ||
| 6686 |
RGB255
|
11년 전 | 962 | |
| 6685 |
|
11년 전 | 639 | |
| 6684 | 11년 전 | 716 | ||
| 6683 | 11년 전 | 385 | ||
| 6682 | 11년 전 | 1125 | ||
| 6681 | 11년 전 | 1413 | ||
| 6680 | 11년 전 | 437 | ||
| 6679 |
RGB255
|
11년 전 | 388 | |
| 6678 | 11년 전 | 1346 | ||
| 6677 |
|
11년 전 | 432 | |
| 6676 | 11년 전 | 1012 | ||
| 6675 |
디자이너필이
|
11년 전 | 822 | |
| 6674 | 11년 전 | 1242 | ||
| 6673 | 11년 전 | 1314 | ||
| 6672 | 11년 전 | 6027 | ||
| 6671 | 11년 전 | 1335 | ||
| 6670 |
하프의정령
|
11년 전 | 568 | |
| 6669 | 11년 전 | 412 | ||
| 6668 |
공부하고가겠슴다
|
11년 전 | 446 | |
| 6667 |
하프의정령
|
11년 전 | 546 | |
| 6666 | 11년 전 | 787 | ||
| 6665 | 11년 전 | 1410 | ||
| 6664 | 11년 전 | 924 | ||
| 6663 | 11년 전 | 1144 | ||
| 6662 | 11년 전 | 410 | ||
| 6661 |
basketball
|
11년 전 | 506 | |
| 6660 | 11년 전 | 2506 | ||
| 6659 | 11년 전 | 1608 | ||
| 6658 |
|
11년 전 | 1324 | |
| 6657 |
|
11년 전 | 3152 | |
| 6656 | 11년 전 | 562 | ||
| 6655 |
프로프리랜서
|
12년 전 | 2332 | |
| 6654 |
프로프리랜서
|
12년 전 | 1905 | |
| 6653 |
프로프리랜서
|
12년 전 | 1745 | |
| 6652 |
프로프리랜서
|
12년 전 | 1830 | |
| 6651 |
|
12년 전 | 779 | |
| 6650 | 12년 전 | 1314 | ||
| 6649 | 12년 전 | 1315 | ||
| 6648 | 12년 전 | 809 | ||
| 6647 | 12년 전 | 3159 | ||
| 6646 | 12년 전 | 466 | ||
| 6645 | 12년 전 | 964 | ||
| 6644 |
BBAYOUNG
|
12년 전 | 1374 | |
| 6643 | 12년 전 | 1788 | ||
| 6642 | 12년 전 | 640 | ||
| 6641 | 12년 전 | 1333 | ||
| 6640 | 12년 전 | 704 | ||
| 6639 | 12년 전 | 2318 | ||
| 6638 |
jasmin2
|
12년 전 | 746 | |
| 6637 |
geektoo
|
12년 전 | 441 | |
| 6636 | 12년 전 | 662 | ||
| 6635 |
프로프리랜서
|
12년 전 | 2226 | |
| 6634 |
프로프리랜서
|
12년 전 | 1738 | |
| 6633 |
프로프리랜서
|
12년 전 | 4057 | |
| 6632 |
프로프리랜서
|
12년 전 | 1346 | |
| 6631 |
프로프리랜서
|
12년 전 | 1780 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기