;(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년 전 | 1403 | ||
| 7029 |
|
11년 전 | 3240 | |
| 7028 |
|
11년 전 | 1135 | |
| 7027 | 11년 전 | 1003 | ||
| 7026 | 11년 전 | 2081 | ||
| 7025 |
어려워요잉
|
11년 전 | 2737 | |
| 7024 | 11년 전 | 2102 | ||
| 7023 | 11년 전 | 3131 | ||
| 7022 |
Shhhh
|
11년 전 | 1526 | |
| 7021 |
|
11년 전 | 3269 | |
| 7020 | 11년 전 | 785 | ||
| 7019 |
막돼먹은영애
|
11년 전 | 1081 | |
| 7018 | 11년 전 | 1953 | ||
| 7017 | 11년 전 | 2311 | ||
| 7016 | 11년 전 | 1021 | ||
| 7015 | 11년 전 | 2825 | ||
| 7014 | 11년 전 | 3029 | ||
| 7013 | 11년 전 | 1518 | ||
| 7012 |
|
11년 전 | 2192 | |
| 7011 | 11년 전 | 1049 | ||
| 7010 | 11년 전 | 1402 | ||
| 7009 |
|
11년 전 | 1071 | |
| 7008 | 11년 전 | 2262 | ||
| 7007 | 11년 전 | 2180 | ||
| 7006 |
|
11년 전 | 1167 | |
| 7005 | 11년 전 | 5305 | ||
| 7004 | 11년 전 | 2353 | ||
| 7003 | 11년 전 | 3063 | ||
| 7002 | 11년 전 | 1914 | ||
| 7001 | 11년 전 | 950 | ||
| 7000 | 11년 전 | 2034 | ||
| 6999 |
|
11년 전 | 2158 | |
| 6998 | 11년 전 | 1876 | ||
| 6997 |
네이비칼라
|
11년 전 | 1490 | |
| 6996 | 11년 전 | 951 | ||
| 6995 |
|
11년 전 | 1848 | |
| 6994 | 11년 전 | 2573 | ||
| 6993 |
kimsdesign
|
11년 전 | 1296 | |
| 6992 |
|
11년 전 | 2773 | |
| 6991 | 11년 전 | 1717 | ||
| 6990 | 11년 전 | 4470 | ||
| 6989 | 11년 전 | 1848 | ||
| 6988 |
네이비컬러
|
11년 전 | 2506 | |
| 6987 | 11년 전 | 3721 | ||
| 6986 |
잘살아보자
|
11년 전 | 1591 | |
| 6985 |
잘살아보자
|
11년 전 | 2466 | |
| 6984 | 11년 전 | 817 | ||
| 6983 |
천재조상훈
|
11년 전 | 1849 | |
| 6982 |
천재조상훈
|
11년 전 | 4481 | |
| 6981 |
천재조상훈
|
11년 전 | 1608 | |
| 6980 |
|
11년 전 | 1864 | |
| 6979 |
|
11년 전 | 745 | |
| 6978 |
잘살아보자
|
11년 전 | 1137 | |
| 6977 |
잘살아보자
|
11년 전 | 1465 | |
| 6976 |
잘살아보자
|
11년 전 | 1569 | |
| 6975 |
천재조상훈
|
11년 전 | 1475 | |
| 6974 |
잘살아보자
|
11년 전 | 2230 | |
| 6973 |
잘살아보자
|
11년 전 | 1153 | |
| 6972 |
잘살아보자
|
11년 전 | 3068 | |
| 6971 |
잘살아보자
|
11년 전 | 3273 | |
| 6970 |
잘살아보자
|
11년 전 | 1836 | |
| 6969 |
잘살아보자
|
11년 전 | 4758 | |
| 6968 | 11년 전 | 9892 | ||
| 6967 |
|
11년 전 | 2629 | |
| 6966 |
|
11년 전 | 1110 | |
| 6965 | 11년 전 | 3255 | ||
| 6964 | 11년 전 | 2578 | ||
| 6963 | 11년 전 | 2100 | ||
| 6962 |
star3840
|
11년 전 | 1015 | |
| 6961 | 11년 전 | 4240 | ||
| 6960 |
|
11년 전 | 710 | |
| 6959 | 11년 전 | 1233 | ||
| 6958 |
|
11년 전 | 1665 | |
| 6957 | 11년 전 | 1888 | ||
| 6956 |
잘살아보자
|
11년 전 | 1849 | |
| 6955 | 11년 전 | 4624 | ||
| 6954 | 11년 전 | 1625 | ||
| 6953 |
잘살아보자
|
11년 전 | 859 | |
| 6952 |
잘살아보자
|
11년 전 | 2040 | |
| 6951 | 11년 전 | 1606 | ||
| 6950 | 11년 전 | 2609 | ||
| 6949 |
잘살아보자
|
11년 전 | 882 | |
| 6948 | 11년 전 | 1552 | ||
| 6947 | 11년 전 | 1464 | ||
| 6946 | 11년 전 | 1602 | ||
| 6945 | 11년 전 | 1227 | ||
| 6944 | 11년 전 | 1184 | ||
| 6943 | 11년 전 | 1229 | ||
| 6942 | 11년 전 | 1569 | ||
| 6941 | 11년 전 | 1655 | ||
| 6940 | 11년 전 | 1751 | ||
| 6939 | 11년 전 | 1661 | ||
| 6938 | 11년 전 | 1939 | ||
| 6937 | 11년 전 | 1148 | ||
| 6936 | 11년 전 | 1346 | ||
| 6935 | 11년 전 | 1298 | ||
| 6934 | 11년 전 | 1464 | ||
| 6933 | 11년 전 | 1972 | ||
| 6932 | 11년 전 | 1529 | ||
| 6931 | 11년 전 | 1534 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기