;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8130 | 9년 전 | 456 | ||
| 8129 |
|
9년 전 | 625 | |
| 8128 | 9년 전 | 491 | ||
| 8127 |
|
9년 전 | 554 | |
| 8126 | 9년 전 | 484 | ||
| 8125 | 9년 전 | 743 | ||
| 8124 |
|
9년 전 | 468 | |
| 8123 | 9년 전 | 457 | ||
| 8122 | 9년 전 | 397 | ||
| 8121 | 9년 전 | 504 | ||
| 8120 | 9년 전 | 440 | ||
| 8119 | 9년 전 | 515 | ||
| 8118 |
|
9년 전 | 598 | |
| 8117 |
|
9년 전 | 376 | |
| 8116 |
PASKRAN
|
9년 전 | 446 | |
| 8115 | 9년 전 | 437 | ||
| 8114 |
kiplayer
|
9년 전 | 574 | |
| 8113 | 9년 전 | 402 | ||
| 8112 |
|
9년 전 | 524 | |
| 8111 | 9년 전 | 373 | ||
| 8110 | 9년 전 | 418 | ||
| 8109 | 9년 전 | 330 | ||
| 8108 |
|
9년 전 | 514 | |
| 8107 |
|
9년 전 | 407 | |
| 8106 |
|
9년 전 | 407 | |
| 8105 | 9년 전 | 448 | ||
| 8104 |
|
9년 전 | 404 | |
| 8103 |
|
9년 전 | 405 | |
| 8102 |
|
9년 전 | 354 | |
| 8101 |
snshero
|
9년 전 | 746 | |
| 8100 | 9년 전 | 811 | ||
| 8099 | 9년 전 | 778 | ||
| 8098 | 9년 전 | 691 | ||
| 8097 | 9년 전 | 481 | ||
| 8096 | 9년 전 | 675 | ||
| 8095 | 9년 전 | 787 | ||
| 8094 | 9년 전 | 472 | ||
| 8093 | 9년 전 | 767 | ||
| 8092 | 9년 전 | 727 | ||
| 8091 | 9년 전 | 1124 | ||
| 8090 | 9년 전 | 731 | ||
| 8089 | 9년 전 | 937 | ||
| 8088 | 9년 전 | 613 | ||
| 8087 | 9년 전 | 715 | ||
| 8086 | 9년 전 | 492 | ||
| 8085 | 9년 전 | 453 | ||
| 8084 | 9년 전 | 593 | ||
| 8083 | 9년 전 | 562 | ||
| 8082 | 9년 전 | 728 | ||
| 8081 | 9년 전 | 441 | ||
| 8080 | 9년 전 | 531 | ||
| 8079 | 9년 전 | 478 | ||
| 8078 | 9년 전 | 417 | ||
| 8077 | 9년 전 | 492 | ||
| 8076 | 9년 전 | 379 | ||
| 8075 | 9년 전 | 395 | ||
| 8074 | 9년 전 | 359 | ||
| 8073 | 9년 전 | 412 | ||
| 8072 | 9년 전 | 399 | ||
| 8071 |
o1o111
|
9년 전 | 848 | |
| 8070 | 9년 전 | 367 | ||
| 8069 | 9년 전 | 300 | ||
| 8068 | 9년 전 | 563 | ||
| 8067 | 9년 전 | 371 | ||
| 8066 | 9년 전 | 397 | ||
| 8065 | 9년 전 | 349 | ||
| 8064 | 9년 전 | 323 | ||
| 8063 | 9년 전 | 288 | ||
| 8062 | 9년 전 | 273 | ||
| 8061 | 9년 전 | 322 | ||
| 8060 | 9년 전 | 344 | ||
| 8059 | 9년 전 | 280 | ||
| 8058 | 9년 전 | 221 | ||
| 8057 | 9년 전 | 341 | ||
| 8056 | 9년 전 | 272 | ||
| 8055 | 9년 전 | 304 | ||
| 8054 | 9년 전 | 326 | ||
| 8053 | 9년 전 | 365 | ||
| 8052 | 9년 전 | 255 | ||
| 8051 | 9년 전 | 296 | ||
| 8050 | 9년 전 | 360 | ||
| 8049 | 9년 전 | 284 | ||
| 8048 | 9년 전 | 400 | ||
| 8047 | 9년 전 | 333 | ||
| 8046 | 9년 전 | 262 | ||
| 8045 | 9년 전 | 232 | ||
| 8044 | 9년 전 | 288 | ||
| 8043 | 9년 전 | 237 | ||
| 8042 | 9년 전 | 266 | ||
| 8041 | 9년 전 | 297 | ||
| 8040 | 9년 전 | 235 | ||
| 8039 | 9년 전 | 292 | ||
| 8038 | 9년 전 | 250 | ||
| 8037 | 9년 전 | 360 | ||
| 8036 | 9년 전 | 448 | ||
| 8035 | 9년 전 | 400 | ||
| 8034 | 9년 전 | 360 | ||
| 8033 | 9년 전 | 315 | ||
| 8032 | 9년 전 | 367 | ||
| 8031 | 9년 전 | 301 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기