;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7030 | 11년 전 | 1429 | ||
| 7029 |
|
11년 전 | 3252 | |
| 7028 |
|
11년 전 | 1157 | |
| 7027 | 11년 전 | 1018 | ||
| 7026 | 11년 전 | 2101 | ||
| 7025 |
어려워요잉
|
11년 전 | 2750 | |
| 7024 | 11년 전 | 2110 | ||
| 7023 | 11년 전 | 3149 | ||
| 7022 |
Shhhh
|
11년 전 | 1546 | |
| 7021 |
|
11년 전 | 3287 | |
| 7020 | 11년 전 | 797 | ||
| 7019 |
막돼먹은영애
|
11년 전 | 1089 | |
| 7018 | 11년 전 | 1970 | ||
| 7017 | 11년 전 | 2331 | ||
| 7016 | 11년 전 | 1036 | ||
| 7015 | 11년 전 | 2840 | ||
| 7014 | 11년 전 | 3034 | ||
| 7013 | 11년 전 | 1520 | ||
| 7012 |
|
11년 전 | 2203 | |
| 7011 | 11년 전 | 1053 | ||
| 7010 | 11년 전 | 1408 | ||
| 7009 |
|
11년 전 | 1091 | |
| 7008 | 11년 전 | 2278 | ||
| 7007 | 11년 전 | 2194 | ||
| 7006 |
|
11년 전 | 1184 | |
| 7005 | 11년 전 | 5317 | ||
| 7004 | 11년 전 | 2368 | ||
| 7003 | 11년 전 | 3082 | ||
| 7002 | 11년 전 | 1934 | ||
| 7001 | 11년 전 | 988 | ||
| 7000 | 11년 전 | 2057 | ||
| 6999 |
|
11년 전 | 2176 | |
| 6998 | 11년 전 | 1894 | ||
| 6997 |
네이비칼라
|
11년 전 | 1503 | |
| 6996 | 11년 전 | 965 | ||
| 6995 |
|
11년 전 | 1870 | |
| 6994 | 11년 전 | 2586 | ||
| 6993 |
kimsdesign
|
11년 전 | 1312 | |
| 6992 |
|
11년 전 | 2782 | |
| 6991 | 11년 전 | 1726 | ||
| 6990 | 11년 전 | 4482 | ||
| 6989 | 11년 전 | 1868 | ||
| 6988 |
네이비컬러
|
11년 전 | 2530 | |
| 6987 | 11년 전 | 3739 | ||
| 6986 |
잘살아보자
|
11년 전 | 1604 | |
| 6985 |
잘살아보자
|
11년 전 | 2487 | |
| 6984 | 11년 전 | 831 | ||
| 6983 |
천재조상훈
|
11년 전 | 1881 | |
| 6982 |
천재조상훈
|
11년 전 | 4514 | |
| 6981 |
천재조상훈
|
11년 전 | 1645 | |
| 6980 |
|
11년 전 | 1895 | |
| 6979 |
|
11년 전 | 768 | |
| 6978 |
잘살아보자
|
11년 전 | 1159 | |
| 6977 |
잘살아보자
|
11년 전 | 1476 | |
| 6976 |
잘살아보자
|
11년 전 | 1586 | |
| 6975 |
천재조상훈
|
11년 전 | 1497 | |
| 6974 |
잘살아보자
|
11년 전 | 2239 | |
| 6973 |
잘살아보자
|
11년 전 | 1167 | |
| 6972 |
잘살아보자
|
11년 전 | 3075 | |
| 6971 |
잘살아보자
|
11년 전 | 3281 | |
| 6970 |
잘살아보자
|
11년 전 | 1854 | |
| 6969 |
잘살아보자
|
11년 전 | 4787 | |
| 6968 | 11년 전 | 9914 | ||
| 6967 |
|
11년 전 | 2646 | |
| 6966 |
|
11년 전 | 1119 | |
| 6965 | 11년 전 | 3269 | ||
| 6964 | 11년 전 | 2593 | ||
| 6963 | 11년 전 | 2112 | ||
| 6962 |
star3840
|
11년 전 | 1026 | |
| 6961 | 11년 전 | 4252 | ||
| 6960 |
|
11년 전 | 741 | |
| 6959 | 11년 전 | 1267 | ||
| 6958 |
|
11년 전 | 1683 | |
| 6957 | 11년 전 | 1911 | ||
| 6956 |
잘살아보자
|
11년 전 | 1861 | |
| 6955 | 11년 전 | 4634 | ||
| 6954 | 11년 전 | 1637 | ||
| 6953 |
잘살아보자
|
11년 전 | 889 | |
| 6952 |
잘살아보자
|
11년 전 | 2056 | |
| 6951 | 11년 전 | 1621 | ||
| 6950 | 11년 전 | 2622 | ||
| 6949 |
잘살아보자
|
11년 전 | 900 | |
| 6948 | 11년 전 | 1565 | ||
| 6947 | 11년 전 | 1476 | ||
| 6946 | 11년 전 | 1625 | ||
| 6945 | 11년 전 | 1233 | ||
| 6944 | 11년 전 | 1197 | ||
| 6943 | 11년 전 | 1239 | ||
| 6942 | 11년 전 | 1593 | ||
| 6941 | 11년 전 | 1667 | ||
| 6940 | 11년 전 | 1762 | ||
| 6939 | 11년 전 | 1672 | ||
| 6938 | 11년 전 | 1954 | ||
| 6937 | 11년 전 | 1165 | ||
| 6936 | 11년 전 | 1367 | ||
| 6935 | 11년 전 | 1311 | ||
| 6934 | 11년 전 | 1476 | ||
| 6933 | 11년 전 | 1988 | ||
| 6932 | 11년 전 | 1548 | ||
| 6931 | 11년 전 | 1552 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기