;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7230 | 11년 전 | 3635 | ||
| 7229 | 11년 전 | 3759 | ||
| 7228 | 11년 전 | 3798 | ||
| 7227 | 11년 전 | 3920 | ||
| 7226 | 11년 전 | 2371 | ||
| 7225 | 11년 전 | 17460 | ||
| 7224 |
AngryDev
|
11년 전 | 1366 | |
| 7223 |
돌아온깡통
|
11년 전 | 1114 | |
| 7222 |
돌아온깡통
|
11년 전 | 1057 | |
| 7221 |
돌아온깡통
|
11년 전 | 890 | |
| 7220 |
돌아온깡통
|
11년 전 | 1009 | |
| 7219 |
돌아온깡통
|
11년 전 | 843 | |
| 7218 |
돌아온깡통
|
11년 전 | 671 | |
| 7217 |
돌아온깡통
|
11년 전 | 1059 | |
| 7216 |
돌아온깡통
|
11년 전 | 799 | |
| 7215 |
돌아온깡통
|
11년 전 | 718 | |
| 7214 |
돌아온깡통
|
11년 전 | 1066 | |
| 7213 |
돌아온깡통
|
11년 전 | 938 | |
| 7212 |
돌아온깡통
|
11년 전 | 722 | |
| 7211 |
돌아온깡통
|
11년 전 | 880 | |
| 7210 |
돌아온깡통
|
11년 전 | 904 | |
| 7209 |
돌아온깡통
|
11년 전 | 895 | |
| 7208 |
돌아온깡통
|
11년 전 | 1014 | |
| 7207 |
돌아온깡통
|
11년 전 | 629 | |
| 7206 |
돌아온깡통
|
11년 전 | 689 | |
| 7205 |
돌아온깡통
|
11년 전 | 874 | |
| 7204 |
돌아온깡통
|
11년 전 | 737 | |
| 7203 |
돌아온깡통
|
11년 전 | 749 | |
| 7202 |
돌아온깡통
|
11년 전 | 726 | |
| 7201 |
돌아온깡통
|
11년 전 | 680 | |
| 7200 |
돌아온깡통
|
11년 전 | 710 | |
| 7199 |
돌아온깡통
|
11년 전 | 1333 | |
| 7198 |
돌아온깡통
|
11년 전 | 661 | |
| 7197 |
돌아온깡통
|
11년 전 | 978 | |
| 7196 |
돌아온깡통
|
11년 전 | 887 | |
| 7195 |
돌아온깡통
|
11년 전 | 623 | |
| 7194 |
돌아온깡통
|
11년 전 | 653 | |
| 7193 |
돌아온깡통
|
11년 전 | 718 | |
| 7192 |
돌아온깡통
|
11년 전 | 748 | |
| 7191 |
joe031
|
11년 전 | 1276 | |
| 7190 | 11년 전 | 4162 | ||
| 7189 | 11년 전 | 1255 | ||
| 7188 |
잘살아보자
|
11년 전 | 970 | |
| 7187 | 11년 전 | 1450 | ||
| 7186 |
kiplayer
|
11년 전 | 7557 | |
| 7185 | 11년 전 | 1145 | ||
| 7184 |
잘살아보자
|
11년 전 | 2344 | |
| 7183 |
잘살아보자
|
11년 전 | 1159 | |
| 7182 |
잘살아보자
|
11년 전 | 1228 | |
| 7181 | 11년 전 | 1498 | ||
| 7180 |
하얀비요일
|
11년 전 | 993 | |
| 7179 |
잘살아보자
|
11년 전 | 1000 | |
| 7178 | 11년 전 | 988 | ||
| 7177 | 11년 전 | 1012 | ||
| 7176 | 11년 전 | 1667 | ||
| 7175 |
|
11년 전 | 1050 | |
| 7174 |
kiplayer
|
11년 전 | 1181 | |
| 7173 | 11년 전 | 962 | ||
| 7172 |
잘살아보자
|
11년 전 | 4649 | |
| 7171 |
잘살아보자
|
11년 전 | 716 | |
| 7170 | 11년 전 | 1080 | ||
| 7169 |
초심의설렘
|
11년 전 | 1479 | |
| 7168 | 11년 전 | 1014 | ||
| 7167 |
잘살아보자
|
11년 전 | 5292 | |
| 7166 |
잘살아보자
|
11년 전 | 3446 | |
| 7165 | 11년 전 | 4962 | ||
| 7164 | 11년 전 | 839 | ||
| 7163 | 11년 전 | 1214 | ||
| 7162 |
울라라라우
|
11년 전 | 1400 | |
| 7161 | 11년 전 | 1272 | ||
| 7160 |
skyler
|
11년 전 | 1194 | |
| 7159 |
|
11년 전 | 714 | |
| 7158 |
|
11년 전 | 3361 | |
| 7157 |
잘살아보자
|
11년 전 | 2898 | |
| 7156 |
잘살아보자
|
11년 전 | 2232 | |
| 7155 |
잘살아보자
|
11년 전 | 1462 | |
| 7154 |
잘살아보자
|
11년 전 | 1451 | |
| 7153 | 11년 전 | 2904 | ||
| 7152 |
울라라라우
|
11년 전 | 835 | |
| 7151 | 11년 전 | 1071 | ||
| 7150 |
잘살아보자
|
11년 전 | 2389 | |
| 7149 |
잘살아보자
|
11년 전 | 3301 | |
| 7148 |
잘살아보자
|
11년 전 | 1200 | |
| 7147 |
잘살아보자
|
11년 전 | 770 | |
| 7146 |
잘살아보자
|
11년 전 | 1412 | |
| 7145 |
잘살아보자
|
11년 전 | 725 | |
| 7144 |
잘살아보자
|
11년 전 | 1321 | |
| 7143 |
잘살아보자
|
11년 전 | 767 | |
| 7142 |
잘살아보자
|
11년 전 | 1460 | |
| 7141 |
잘살아보자
|
11년 전 | 1202 | |
| 7140 |
잘살아보자
|
11년 전 | 2022 | |
| 7139 |
잘살아보자
|
11년 전 | 3687 | |
| 7138 |
잘살아보자
|
11년 전 | 3182 | |
| 7137 |
잘살아보자
|
11년 전 | 3637 | |
| 7136 |
잘살아보자
|
11년 전 | 1393 | |
| 7135 |
gooroo
|
11년 전 | 1618 | |
| 7134 |
열라뽕똬이
|
11년 전 | 2326 | |
| 7133 |
|
11년 전 | 1025 | |
| 7132 | 11년 전 | 1437 | ||
| 7131 | 11년 전 | 3580 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기