;(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 하게 하셔도 되고.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6930 |
SOFTA
|
11년 전 | 5984 | |
| 6929 |
|
11년 전 | 1596 | |
| 6928 | 11년 전 | 1757 | ||
| 6927 | 11년 전 | 1780 | ||
| 6926 | 11년 전 | 1884 | ||
| 6925 | 11년 전 | 2276 | ||
| 6924 | 11년 전 | 3875 | ||
| 6923 | 11년 전 | 2273 | ||
| 6922 |
level999
|
11년 전 | 1041 | |
| 6921 | 11년 전 | 822 | ||
| 6920 | 11년 전 | 957 | ||
| 6919 | 11년 전 | 1072 | ||
| 6918 | 11년 전 | 1312 | ||
| 6917 | 11년 전 | 15428 | ||
| 6916 | 11년 전 | 1426 | ||
| 6915 | 11년 전 | 588 | ||
| 6914 | 11년 전 | 616 | ||
| 6913 | 11년 전 | 880 | ||
| 6912 | 11년 전 | 3126 | ||
| 6911 |
사랑해요79
|
11년 전 | 967 | |
| 6910 | 11년 전 | 746 | ||
| 6909 | 11년 전 | 781 | ||
| 6908 | 11년 전 | 644 | ||
| 6907 | 11년 전 | 832 | ||
| 6906 | 11년 전 | 1588 | ||
| 6905 | 11년 전 | 569 | ||
| 6904 | 11년 전 | 1010 | ||
| 6903 | 11년 전 | 1676 | ||
| 6902 |
2donggalbi
|
11년 전 | 516 | |
| 6901 | 11년 전 | 1395 | ||
| 6900 | 11년 전 | 723 | ||
| 6899 | 11년 전 | 861 | ||
| 6898 |
열라뽕똬이
|
11년 전 | 1318 | |
| 6897 |
this1mg
|
11년 전 | 1614 | |
| 6896 |
sbdossb
|
11년 전 | 580 | |
| 6895 |
봉보로봉봉
|
11년 전 | 1154 | |
| 6894 |
똘똘이스머츠
|
11년 전 | 497 | |
| 6893 |
네이비컬러
|
11년 전 | 3640 | |
| 6892 | 11년 전 | 1077 | ||
| 6891 |
네이비컬러
|
11년 전 | 1319 | |
| 6890 | 11년 전 | 1143 | ||
| 6889 | 11년 전 | 590 | ||
| 6888 | 11년 전 | 726 | ||
| 6887 | 11년 전 | 617 | ||
| 6886 | 11년 전 | 5060 | ||
| 6885 | 11년 전 | 557 | ||
| 6884 |
asfasdfd235
|
11년 전 | 586 | |
| 6883 | 11년 전 | 3040 | ||
| 6882 | 11년 전 | 943 | ||
| 6881 | 11년 전 | 4432 | ||
| 6880 | 11년 전 | 1818 | ||
| 6879 |
퍼블리셔지노군
|
11년 전 | 2631 | |
| 6878 | 11년 전 | 560 | ||
| 6877 | 11년 전 | 583 | ||
| 6876 | 11년 전 | 1445 | ||
| 6875 | 11년 전 | 630 | ||
| 6874 | 11년 전 | 1603 | ||
| 6873 | 11년 전 | 1606 | ||
| 6872 | 11년 전 | 4461 | ||
| 6871 |
Abilityarch
|
11년 전 | 966 | |
| 6870 | 11년 전 | 2128 | ||
| 6869 | 11년 전 | 1410 | ||
| 6868 | 11년 전 | 1455 | ||
| 6867 | 11년 전 | 1527 | ||
| 6866 | 11년 전 | 745 | ||
| 6865 | 11년 전 | 1617 | ||
| 6864 | 11년 전 | 477 | ||
| 6863 | 11년 전 | 3751 | ||
| 6862 | 11년 전 | 1851 | ||
| 6861 | 11년 전 | 1647 | ||
| 6860 | 11년 전 | 1310 | ||
| 6859 |
cityman
|
11년 전 | 6815 | |
| 6858 | 11년 전 | 1271 | ||
| 6857 |
의정부아줌마
|
11년 전 | 874 | |
| 6856 | 11년 전 | 2376 | ||
| 6855 | 11년 전 | 1702 | ||
| 6854 | 11년 전 | 831 | ||
| 6853 | 11년 전 | 1210 | ||
| 6852 | 11년 전 | 2600 | ||
| 6851 | 11년 전 | 1976 | ||
| 6850 | 11년 전 | 1797 | ||
| 6849 | 11년 전 | 2085 | ||
| 6848 | 11년 전 | 2368 | ||
| 6847 | 11년 전 | 3146 | ||
| 6846 | 11년 전 | 2722 | ||
| 6845 | 11년 전 | 2801 | ||
| 6844 | 11년 전 | 3526 | ||
| 6843 | 11년 전 | 3267 | ||
| 6842 |
아트291
|
11년 전 | 697 | |
| 6841 | 11년 전 | 4172 | ||
| 6840 | 11년 전 | 5189 | ||
| 6839 | 11년 전 | 894 | ||
| 6838 |
|
11년 전 | 2097 | |
| 6837 | 11년 전 | 1279 | ||
| 6836 |
netdf
|
11년 전 | 615 | |
| 6835 |
|
11년 전 | 1011 | |
| 6834 | 11년 전 | 674 | ||
| 6833 |
|
11년 전 | 2687 | |
| 6832 |
울산굿모닝
|
11년 전 | 1664 | |
| 6831 |
|
11년 전 | 675 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기