;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7330 | 11년 전 | 1669 | ||
| 7329 | 11년 전 | 930 | ||
| 7328 | 11년 전 | 2215 | ||
| 7327 | 11년 전 | 1715 | ||
| 7326 | 11년 전 | 3796 | ||
| 7325 | 11년 전 | 2261 | ||
| 7324 | 11년 전 | 4505 | ||
| 7323 |
호식이와미돌
|
11년 전 | 1276 | |
| 7322 |
호식이와미돌
|
11년 전 | 1137 | |
| 7321 | 11년 전 | 1779 | ||
| 7320 | 11년 전 | 1753 | ||
| 7319 | 11년 전 | 1314 | ||
| 7318 |
|
11년 전 | 964 | |
| 7317 |
멋진남자임
|
11년 전 | 1612 | |
| 7316 |
잘살아보자
|
11년 전 | 982 | |
| 7315 | 11년 전 | 1085 | ||
| 7314 | 11년 전 | 1303 | ||
| 7313 |
잘살아보자
|
11년 전 | 1115 | |
| 7312 | 11년 전 | 875 | ||
| 7311 |
사랑한데이
|
11년 전 | 2055 | |
| 7310 |
잘살아보자
|
11년 전 | 1870 | |
| 7309 |
잘살아보자
|
11년 전 | 3039 | |
| 7308 |
잘살아보자
|
11년 전 | 1015 | |
| 7307 |
잘살아보자
|
11년 전 | 778 | |
| 7306 | 11년 전 | 863 | ||
| 7305 |
잘살아보자
|
11년 전 | 2754 | |
| 7304 | 11년 전 | 1012 | ||
| 7303 | 11년 전 | 1211 | ||
| 7302 | 11년 전 | 715 | ||
| 7301 | 11년 전 | 1498 | ||
| 7300 |
mijaya
|
11년 전 | 1490 | |
| 7299 | 11년 전 | 901 | ||
| 7298 | 11년 전 | 1082 | ||
| 7297 | 11년 전 | 762 | ||
| 7296 | 11년 전 | 721 | ||
| 7295 | 11년 전 | 1551 | ||
| 7294 | 11년 전 | 894 | ||
| 7293 | 11년 전 | 798 | ||
| 7292 | 11년 전 | 903 | ||
| 7291 |
잘살아보자
|
11년 전 | 1089 | |
| 7290 |
잘살아보자
|
11년 전 | 736 | |
| 7289 | 11년 전 | 781 | ||
| 7288 |
잘살아보자
|
11년 전 | 1297 | |
| 7287 | 11년 전 | 819 | ||
| 7286 |
잘살아보자
|
11년 전 | 1316 | |
| 7285 | 11년 전 | 810 | ||
| 7284 | 11년 전 | 978 | ||
| 7283 | 11년 전 | 1006 | ||
| 7282 | 11년 전 | 757 | ||
| 7281 | 11년 전 | 787 | ||
| 7280 | 11년 전 | 1025 | ||
| 7279 | 11년 전 | 1955 | ||
| 7278 | 11년 전 | 787 | ||
| 7277 | 11년 전 | 803 | ||
| 7276 | 11년 전 | 742 | ||
| 7275 | 11년 전 | 1156 | ||
| 7274 | 11년 전 | 806 | ||
| 7273 | 11년 전 | 710 | ||
| 7272 | 11년 전 | 1041 | ||
| 7271 | 11년 전 | 1370 | ||
| 7270 | 11년 전 | 997 | ||
| 7269 | 11년 전 | 925 | ||
| 7268 | 11년 전 | 966 | ||
| 7267 | 11년 전 | 1800 | ||
| 7266 | 11년 전 | 871 | ||
| 7265 | 11년 전 | 928 | ||
| 7264 |
잘살아보자
|
11년 전 | 2705 | |
| 7263 |
잘살아보자
|
11년 전 | 2253 | |
| 7262 |
잘살아보자
|
11년 전 | 1138 | |
| 7261 |
잘살아보자
|
11년 전 | 1627 | |
| 7260 |
잘살아보자
|
11년 전 | 1242 | |
| 7259 | 11년 전 | 1155 | ||
| 7258 |
잘살아보자
|
11년 전 | 1288 | |
| 7257 |
잘살아보자
|
11년 전 | 1889 | |
| 7256 | 11년 전 | 929 | ||
| 7255 |
그누5입문
|
11년 전 | 1937 | |
| 7254 | 11년 전 | 2161 | ||
| 7253 |
|
11년 전 | 856 | |
| 7252 | 11년 전 | 1001 | ||
| 7251 | 11년 전 | 712 | ||
| 7250 | 11년 전 | 1673 | ||
| 7249 | 11년 전 | 1543 | ||
| 7248 |
sogo87
|
11년 전 | 1031 | |
| 7247 | 11년 전 | 912 | ||
| 7246 | 11년 전 | 687 | ||
| 7245 |
잘살아보자
|
11년 전 | 1067 | |
| 7244 | 11년 전 | 1519 | ||
| 7243 |
presee
|
11년 전 | 587 | |
| 7242 |
sogo87
|
11년 전 | 778 | |
| 7241 | 11년 전 | 857 | ||
| 7240 |
브라이언2
|
11년 전 | 880 | |
| 7239 |
|
11년 전 | 1086 | |
| 7238 | 11년 전 | 2616 | ||
| 7237 |
잘살아보자
|
11년 전 | 2274 | |
| 7236 |
dethos79
|
11년 전 | 1836 | |
| 7235 |
멋진남자임
|
11년 전 | 1396 | |
| 7234 | 11년 전 | 1338 | ||
| 7233 | 11년 전 | 2311 | ||
| 7232 | 11년 전 | 1580 | ||
| 7231 | 11년 전 | 2780 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기