;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7430 |
|
11년 전 | 4947 | |
| 7429 | 11년 전 | 1780 | ||
| 7428 |
멋진남자임
|
11년 전 | 1174 | |
| 7427 |
sdflksdj2
|
11년 전 | 831 | |
| 7426 | 11년 전 | 1366 | ||
| 7425 | 11년 전 | 1393 | ||
| 7424 | 11년 전 | 1054 | ||
| 7423 |
SeungYeon
|
11년 전 | 565 | |
| 7422 | 11년 전 | 811 | ||
| 7421 |
sdflksdj2
|
11년 전 | 691 | |
| 7420 | 11년 전 | 974 | ||
| 7419 |
|
11년 전 | 1405 | |
| 7418 |
멋진남자임
|
11년 전 | 1442 | |
| 7417 | 11년 전 | 608 | ||
| 7416 |
senseme
|
11년 전 | 1233 | |
| 7415 | 11년 전 | 963 | ||
| 7414 | 11년 전 | 715 | ||
| 7413 | 11년 전 | 4851 | ||
| 7412 | 11년 전 | 4408 | ||
| 7411 |
holla
|
11년 전 | 898 | |
| 7410 | 11년 전 | 4254 | ||
| 7409 | 11년 전 | 3929 | ||
| 7408 | 11년 전 | 4273 | ||
| 7407 | 11년 전 | 5091 | ||
| 7406 | 11년 전 | 4737 | ||
| 7405 | 11년 전 | 4303 | ||
| 7404 | 11년 전 | 765 | ||
| 7403 | 11년 전 | 5685 | ||
| 7402 | 11년 전 | 1522 | ||
| 7401 |
|
11년 전 | 979 | |
| 7400 | 11년 전 | 2975 | ||
| 7399 |
멋진남자임
|
11년 전 | 920 | |
| 7398 |
파랑새1597
|
11년 전 | 2708 | |
| 7397 | 11년 전 | 2278 | ||
| 7396 |
basketball
|
11년 전 | 1377 | |
| 7395 | 11년 전 | 1615 | ||
| 7394 | 11년 전 | 934 | ||
| 7393 | 11년 전 | 2075 | ||
| 7392 | 11년 전 | 852 | ||
| 7391 |
잘살아보자
|
11년 전 | 5365 | |
| 7390 |
잘살아보자
|
11년 전 | 2230 | |
| 7389 |
잘살아보자
|
11년 전 | 3323 | |
| 7388 |
파랑새1597
|
11년 전 | 932 | |
| 7387 | 11년 전 | 1108 | ||
| 7386 |
프리랜서퍼블리셔
|
11년 전 | 974 | |
| 7385 | 11년 전 | 1572 | ||
| 7384 |
울라라라우
|
11년 전 | 893 | |
| 7383 | 11년 전 | 1559 | ||
| 7382 |
잘살아보자
|
11년 전 | 4230 | |
| 7381 |
잘살아보자
|
11년 전 | 2002 | |
| 7380 |
잘살아보자
|
11년 전 | 1945 | |
| 7379 |
잘살아보자
|
11년 전 | 5911 | |
| 7378 |
senseme
|
11년 전 | 1902 | |
| 7377 |
잘살아보자
|
11년 전 | 2751 | |
| 7376 | 11년 전 | 2420 | ||
| 7375 |
잘살아보자
|
11년 전 | 1053 | |
| 7374 |
잘살아보자
|
11년 전 | 3166 | |
| 7373 |
잘살아보자
|
11년 전 | 2483 | |
| 7372 |
잘살아보자
|
11년 전 | 5834 | |
| 7371 |
잘살아보자
|
11년 전 | 3470 | |
| 7370 |
잘살아보자
|
11년 전 | 1917 | |
| 7369 |
잘살아보자
|
11년 전 | 2175 | |
| 7368 |
ksdhtm56
|
11년 전 | 575 | |
| 7367 | 11년 전 | 1438 | ||
| 7366 | 11년 전 | 936 | ||
| 7365 | 11년 전 | 3550 | ||
| 7364 |
잘살아보자
|
11년 전 | 1400 | |
| 7363 |
잘살아보자
|
11년 전 | 1372 | |
| 7362 |
잘살아보자
|
11년 전 | 1513 | |
| 7361 | 11년 전 | 3600 | ||
| 7360 | 11년 전 | 3564 | ||
| 7359 | 11년 전 | 3383 | ||
| 7358 |
멋진남자임
|
11년 전 | 1031 | |
| 7357 | 11년 전 | 3418 | ||
| 7356 | 11년 전 | 2604 | ||
| 7355 | 11년 전 | 3198 | ||
| 7354 |
파랑새1597
|
11년 전 | 652 | |
| 7353 |
잘살아보자
|
11년 전 | 2430 | |
| 7352 |
잘살아보자
|
11년 전 | 2421 | |
| 7351 |
잘살아보자
|
11년 전 | 2483 | |
| 7350 |
잘살아보자
|
11년 전 | 1478 | |
| 7349 |
잘살아보자
|
11년 전 | 1971 | |
| 7348 |
잘살아보자
|
11년 전 | 1288 | |
| 7347 |
잘살아보자
|
11년 전 | 1084 | |
| 7346 |
멋진남자임
|
11년 전 | 1652 | |
| 7345 | 11년 전 | 995 | ||
| 7344 | 11년 전 | 3878 | ||
| 7343 | 11년 전 | 3661 | ||
| 7342 | 11년 전 | 1288 | ||
| 7341 | 11년 전 | 2526 | ||
| 7340 |
|
11년 전 | 941 | |
| 7339 | 11년 전 | 1740 | ||
| 7338 | 11년 전 | 3351 | ||
| 7337 | 11년 전 | 3666 | ||
| 7336 | 11년 전 | 4605 | ||
| 7335 | 11년 전 | 982 | ||
| 7334 | 11년 전 | 1538 | ||
| 7333 | 11년 전 | 2942 | ||
| 7332 |
|
11년 전 | 1114 | |
| 7331 |
KeePin뽁이
|
11년 전 | 1107 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기