;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 330 |
prosper
|
20년 전 | 2242 | |
| 329 |
prosper
|
20년 전 | 1852 | |
| 328 |
prosper
|
20년 전 | 1662 | |
| 327 | 20년 전 | 3740 | ||
| 326 | 20년 전 | 4817 | ||
| 325 |
hwatta
|
20년 전 | 2436 | |
| 324 |
|
20년 전 | 3119 | |
| 323 | 20년 전 | 5828 | ||
| 322 |
hwatta
|
20년 전 | 2817 | |
| 321 |
hwatta
|
20년 전 | 2295 | |
| 320 |
yesmoa
|
20년 전 | 4550 | |
| 319 | 20년 전 | 2650 | ||
| 318 | 20년 전 | 2224 | ||
| 317 |
kyodon
|
20년 전 | 2750 | |
| 316 | 20년 전 | 2555 | ||
| 315 |
|
20년 전 | 2868 | |
| 314 |
|
20년 전 | 3307 | |
| 313 |
|
20년 전 | 2624 | |
| 312 |
yesmoa
|
20년 전 | 4698 | |
| 311 | 20년 전 | 3227 | ||
| 310 |
홀로남은자
|
20년 전 | 4538 | |
| 309 | 20년 전 | 2993 | ||
| 308 | 20년 전 | 4106 | ||
| 307 | 20년 전 | 4341 | ||
| 306 | 20년 전 | 7010 | ||
| 305 | 20년 전 | 3843 | ||
| 304 | 20년 전 | 2742 | ||
| 303 |
크리스탈처럼
|
20년 전 | 4375 | |
| 302 | 20년 전 | 2188 | ||
| 301 |
|
20년 전 | 4311 | |
| 300 | 20년 전 | 3768 | ||
| 299 | 20년 전 | 2567 | ||
| 298 | 20년 전 | 4794 | ||
| 297 |
|
20년 전 | 2506 | |
| 296 | 20년 전 | 4500 | ||
| 295 | 20년 전 | 3552 | ||
| 294 | 20년 전 | 3570 | ||
| 293 | 20년 전 | 3804 | ||
| 292 | 20년 전 | 3186 | ||
| 291 |
yesmoa
|
20년 전 | 5901 | |
| 290 | 20년 전 | 2921 | ||
| 289 | 20년 전 | 5827 | ||
| 288 |
|
20년 전 | 2351 | |
| 287 |
|
20년 전 | 1759 | |
| 286 |
|
20년 전 | 2124 | |
| 285 |
|
20년 전 | 3519 | |
| 284 |
|
20년 전 | 2017 | |
| 283 |
|
20년 전 | 4384 | |
| 282 | 20년 전 | 3364 | ||
| 281 |
|
20년 전 | 2190 | |
| 280 |
|
20년 전 | 7784 | |
| 279 | 20년 전 | 5522 | ||
| 278 | 20년 전 | 2972 | ||
| 277 |
|
20년 전 | 5554 | |
| 276 | 20년 전 | 2341 | ||
| 275 | 20년 전 | 2579 | ||
| 274 | 20년 전 | 2345 | ||
| 273 | 20년 전 | 2196 | ||
| 272 | 20년 전 | 2118 | ||
| 271 | 20년 전 | 2587 | ||
| 270 | 20년 전 | 2575 | ||
| 269 | 20년 전 | 2457 | ||
| 268 | 20년 전 | 2663 | ||
| 267 | 20년 전 | 2349 | ||
| 266 | 20년 전 | 2551 | ||
| 265 | 20년 전 | 3482 | ||
| 264 |
|
20년 전 | 5337 | |
| 263 |
|
20년 전 | 3699 | |
| 262 | 20년 전 | 3151 | ||
| 261 |
허저비
|
20년 전 | 5907 | |
| 260 |
|
20년 전 | 5701 | |
| 259 | 20년 전 | 4121 | ||
| 258 | 20년 전 | 2365 | ||
| 257 | 20년 전 | 3166 | ||
| 256 | 20년 전 | 1887 | ||
| 255 | 20년 전 | 1548 | ||
| 254 | 20년 전 | 3124 | ||
| 253 | 20년 전 | 3535 | ||
| 252 | 20년 전 | 5085 | ||
| 251 | 20년 전 | 5794 | ||
| 250 | 20년 전 | 3655 | ||
| 249 | 20년 전 | 4992 | ||
| 248 | 20년 전 | 3271 | ||
| 247 | 20년 전 | 3618 | ||
| 246 |
|
20년 전 | 7929 | |
| 245 |
|
20년 전 | 5886 | |
| 244 | 20년 전 | 4467 | ||
| 243 |
|
20년 전 | 4023 | |
| 242 | 20년 전 | 2751 | ||
| 241 | 20년 전 | 2694 | ||
| 240 | 20년 전 | 2331 | ||
| 239 | 20년 전 | 1634 | ||
| 238 |
아우겐나이스
|
20년 전 | 2240 | |
| 237 |
email
|
20년 전 | 3663 | |
| 236 | 20년 전 | 4122 | ||
| 235 | 20년 전 | 10443 | ||
| 234 | 20년 전 | 5039 | ||
| 233 | 20년 전 | 3356 | ||
| 232 | 20년 전 | 3177 | ||
| 231 | 20년 전 | 3810 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기