;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 430 | 19년 전 | 4086 | ||
| 429 | 19년 전 | 3282 | ||
| 428 | 19년 전 | 4117 | ||
| 427 | 19년 전 | 3461 | ||
| 426 | 19년 전 | 3092 | ||
| 425 | 19년 전 | 3387 | ||
| 424 | 19년 전 | 2430 | ||
| 423 | 19년 전 | 2837 | ||
| 422 | 19년 전 | 2332 | ||
| 421 | 19년 전 | 3700 | ||
| 420 | 19년 전 | 4723 | ||
| 419 | 19년 전 | 3771 | ||
| 418 |
|
19년 전 | 1723 | |
| 417 | 19년 전 | 2729 | ||
| 416 | 19년 전 | 2377 | ||
| 415 | 19년 전 | 2599 | ||
| 414 | 19년 전 | 4394 | ||
| 413 |
|
19년 전 | 2567 | |
| 412 | 19년 전 | 3024 | ||
| 411 |
|
19년 전 | 2975 | |
| 410 |
|
19년 전 | 3661 | |
| 409 |
|
19년 전 | 3619 | |
| 408 |
|
19년 전 | 1837 | |
| 407 | 19년 전 | 2204 | ||
| 406 | 19년 전 | 2766 | ||
| 405 | 19년 전 | 2432 | ||
| 404 | 19년 전 | 4290 | ||
| 403 | 19년 전 | 3287 | ||
| 402 |
NeoGenesis
|
19년 전 | 4074 | |
| 401 | 19년 전 | 2589 | ||
| 400 |
|
19년 전 | 2473 | |
| 399 | 19년 전 | 2941 | ||
| 398 | 19년 전 | 2472 | ||
| 397 | 19년 전 | 2773 | ||
| 396 | 19년 전 | 2459 | ||
| 395 | 19년 전 | 3165 | ||
| 394 | 19년 전 | 1691 | ||
| 393 | 19년 전 | 2977 | ||
| 392 | 19년 전 | 2238 | ||
| 391 | 19년 전 | 2170 | ||
| 390 | 19년 전 | 2263 | ||
| 389 | 19년 전 | 2624 | ||
| 388 | 19년 전 | 2116 | ||
| 387 | 19년 전 | 4462 | ||
| 386 |
|
19년 전 | 2668 | |
| 385 |
|
19년 전 | 2453 | |
| 384 | 19년 전 | 2968 | ||
| 383 | 19년 전 | 3034 | ||
| 382 | 19년 전 | 3087 | ||
| 381 |
|
19년 전 | 2621 | |
| 380 |
|
19년 전 | 3001 | |
| 379 | 19년 전 | 2536 | ||
| 378 | 19년 전 | 2192 | ||
| 377 | 19년 전 | 2768 | ||
| 376 | 19년 전 | 2463 | ||
| 375 |
|
19년 전 | 2546 | |
| 374 | 19년 전 | 3793 | ||
| 373 | 19년 전 | 3253 | ||
| 372 | 19년 전 | 4972 | ||
| 371 |
세은아빠2
|
19년 전 | 2398 | |
| 370 | 19년 전 | 4489 | ||
| 369 | 19년 전 | 3092 | ||
| 368 | 19년 전 | 2877 | ||
| 367 | 19년 전 | 3716 | ||
| 366 | 19년 전 | 2626 | ||
| 365 | 19년 전 | 3713 | ||
| 364 | 19년 전 | 3992 | ||
| 363 | 19년 전 | 3417 | ||
| 362 | 19년 전 | 3467 | ||
| 361 | 19년 전 | 4086 | ||
| 360 |
hwatta
|
19년 전 | 2344 | |
| 359 | 19년 전 | 5080 | ||
| 358 | 19년 전 | 3634 | ||
| 357 | 19년 전 | 2576 | ||
| 356 |
sdesign1s
|
19년 전 | 2258 | |
| 355 | 20년 전 | 2721 | ||
| 354 | 20년 전 | 3014 | ||
| 353 | 20년 전 | 2781 | ||
| 352 |
|
20년 전 | 5761 | |
| 351 |
|
20년 전 | 2688 | |
| 350 |
|
20년 전 | 4267 | |
| 349 |
hwatta
|
20년 전 | 2159 | |
| 348 | 20년 전 | 7297 | ||
| 347 | 20년 전 | 2401 | ||
| 346 | 20년 전 | 3480 | ||
| 345 | 20년 전 | 4286 | ||
| 344 | 20년 전 | 2610 | ||
| 343 | 20년 전 | 3900 | ||
| 342 | 20년 전 | 3049 | ||
| 341 | 20년 전 | 4073 | ||
| 340 |
|
20년 전 | 5104 | |
| 339 |
|
20년 전 | 4213 | |
| 338 | 20년 전 | 5839 | ||
| 337 | 20년 전 | 2019 | ||
| 336 |
|
20년 전 | 3294 | |
| 335 |
|
20년 전 | 3522 | |
| 334 |
|
20년 전 | 2905 | |
| 333 |
hwatta
|
20년 전 | 2413 | |
| 332 | 20년 전 | 4639 | ||
| 331 | 20년 전 | 2258 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기