;(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년 전 | 5986 | |
| 6929 |
|
11년 전 | 1603 | |
| 6928 | 11년 전 | 1762 | ||
| 6927 | 11년 전 | 1788 | ||
| 6926 | 11년 전 | 1887 | ||
| 6925 | 11년 전 | 2279 | ||
| 6924 | 11년 전 | 3877 | ||
| 6923 | 11년 전 | 2279 | ||
| 6922 |
level999
|
11년 전 | 1045 | |
| 6921 | 11년 전 | 822 | ||
| 6920 | 11년 전 | 963 | ||
| 6919 | 11년 전 | 1074 | ||
| 6918 | 11년 전 | 1316 | ||
| 6917 | 11년 전 | 15430 | ||
| 6916 | 11년 전 | 1429 | ||
| 6915 | 11년 전 | 590 | ||
| 6914 | 11년 전 | 623 | ||
| 6913 | 11년 전 | 882 | ||
| 6912 | 11년 전 | 3134 | ||
| 6911 |
사랑해요79
|
11년 전 | 973 | |
| 6910 | 11년 전 | 750 | ||
| 6909 | 11년 전 | 786 | ||
| 6908 | 11년 전 | 648 | ||
| 6907 | 11년 전 | 835 | ||
| 6906 | 11년 전 | 1592 | ||
| 6905 | 11년 전 | 576 | ||
| 6904 | 11년 전 | 1015 | ||
| 6903 | 11년 전 | 1685 | ||
| 6902 |
2donggalbi
|
11년 전 | 525 | |
| 6901 | 11년 전 | 1401 | ||
| 6900 | 11년 전 | 725 | ||
| 6899 | 11년 전 | 867 | ||
| 6898 |
열라뽕똬이
|
11년 전 | 1319 | |
| 6897 |
this1mg
|
11년 전 | 1618 | |
| 6896 |
sbdossb
|
11년 전 | 587 | |
| 6895 |
봉보로봉봉
|
11년 전 | 1162 | |
| 6894 |
똘똘이스머츠
|
11년 전 | 501 | |
| 6893 |
네이비컬러
|
11년 전 | 3647 | |
| 6892 | 11년 전 | 1081 | ||
| 6891 |
네이비컬러
|
11년 전 | 1328 | |
| 6890 | 11년 전 | 1154 | ||
| 6889 | 11년 전 | 595 | ||
| 6888 | 11년 전 | 731 | ||
| 6887 | 11년 전 | 623 | ||
| 6886 | 11년 전 | 5063 | ||
| 6885 | 11년 전 | 562 | ||
| 6884 |
asfasdfd235
|
11년 전 | 593 | |
| 6883 | 11년 전 | 3057 | ||
| 6882 | 11년 전 | 953 | ||
| 6881 | 11년 전 | 4446 | ||
| 6880 | 11년 전 | 1827 | ||
| 6879 |
퍼블리셔지노군
|
11년 전 | 2639 | |
| 6878 | 11년 전 | 573 | ||
| 6877 | 11년 전 | 589 | ||
| 6876 | 11년 전 | 1453 | ||
| 6875 | 11년 전 | 636 | ||
| 6874 | 11년 전 | 1609 | ||
| 6873 | 11년 전 | 1610 | ||
| 6872 | 11년 전 | 4467 | ||
| 6871 |
Abilityarch
|
11년 전 | 974 | |
| 6870 | 11년 전 | 2135 | ||
| 6869 | 11년 전 | 1416 | ||
| 6868 | 11년 전 | 1463 | ||
| 6867 | 11년 전 | 1532 | ||
| 6866 | 11년 전 | 751 | ||
| 6865 | 11년 전 | 1625 | ||
| 6864 | 11년 전 | 483 | ||
| 6863 | 11년 전 | 3757 | ||
| 6862 | 11년 전 | 1856 | ||
| 6861 | 11년 전 | 1654 | ||
| 6860 | 11년 전 | 1313 | ||
| 6859 |
cityman
|
11년 전 | 6819 | |
| 6858 | 11년 전 | 1277 | ||
| 6857 |
의정부아줌마
|
11년 전 | 875 | |
| 6856 | 11년 전 | 2379 | ||
| 6855 | 11년 전 | 1710 | ||
| 6854 | 11년 전 | 837 | ||
| 6853 | 11년 전 | 1213 | ||
| 6852 | 11년 전 | 2603 | ||
| 6851 | 11년 전 | 1980 | ||
| 6850 | 11년 전 | 1804 | ||
| 6849 | 11년 전 | 2095 | ||
| 6848 | 11년 전 | 2373 | ||
| 6847 | 11년 전 | 3150 | ||
| 6846 | 11년 전 | 2727 | ||
| 6845 | 11년 전 | 2809 | ||
| 6844 | 11년 전 | 3533 | ||
| 6843 | 11년 전 | 3278 | ||
| 6842 |
아트291
|
11년 전 | 698 | |
| 6841 | 11년 전 | 4174 | ||
| 6840 | 11년 전 | 5192 | ||
| 6839 | 11년 전 | 903 | ||
| 6838 |
|
11년 전 | 2102 | |
| 6837 | 11년 전 | 1286 | ||
| 6836 |
netdf
|
11년 전 | 621 | |
| 6835 |
|
11년 전 | 1015 | |
| 6834 | 11년 전 | 684 | ||
| 6833 |
|
11년 전 | 2693 | |
| 6832 |
울산굿모닝
|
11년 전 | 1673 | |
| 6831 |
|
11년 전 | 676 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기