반응형웹 질문좀드려요~~~~ ㅠㅠ
안녕하세여 퍼블리셔
선배님들
다름이 아니라 윈도우 리사이즈에 관한 질문인데요
$(document).ready(function(){ gnbControl(); });
$(window).resize(function(){ gnbControl(); });
function gnbControl( ) {
var wrap_w = $(window).width();
if (wrap_w >= 1270){
$(".gnb > li").unbind();
gnb01();
} else {
$(".gnb > li").unbind();
gnb02();
}
}
var wrap_w = $(window).width();
if (wrap_w >= 1270){
$(".gnb > li").unbind();
gnb01();
} else {
$(".gnb > li").unbind();
gnb02();
}
}
function gnb01(){
$(".gnb > li").bind("mouseenter focusin",function(){
$(".mBox").animate({"width":"1500px"});
});
$(".gnb > li").bind("mouseleave focusout",function(){
$(".mBox").animate({"width":"500px"});
});
}
$(".gnb > li").bind("mouseenter focusin",function(){
$(".mBox").animate({"width":"1500px"});
});
$(".gnb > li").bind("mouseleave focusout",function(){
$(".mBox").animate({"width":"500px"});
});
}
function gnb02(){
$(".gnb > li").bind("mouseenter focusin",function(){
$(".mBox").animate({"width":"200px"});
});
$(".gnb > li").bind("mouseleave focusout",function(){
$(".mBox").animate({"width":"100px"});
});
}
$(".gnb > li").bind("mouseenter focusin",function(){
$(".mBox").animate({"width":"200px"});
});
$(".gnb > li").bind("mouseleave focusout",function(){
$(".mBox").animate({"width":"100px"});
});
}
.mBox {width:100%;height:50px;margin-top:50px;background:url('../images/') green;}
여기서 window 가 1270 인상태로
gnb li 영역에 마우스가 올려졌다가 나온상태가 되면
mBox 의 넓이가 500이 되는데
1270 이하로 내려갔을때도
mBox 의 넓이가 500이 됩니다.
1270 이하일때는
gnb01 로 발생한 모든 액션들이 제거 됬으면 좋겠거든요
gnb01 에
$(".mBox").css({"width":"100%"}); 추가하면 되지만
다잡아야 할부분들이 너무 많아서 ㅠㅠ
이런방법말고
window 가 1270 이하일때는
gnb01 로 인해 발생한 액션들을 삭제하고
gnb02 만 적용시키고
window 가 1270 이상일때는
gnb02로 인해 발생한 액션들을 삭제하고
gnb01만 적용시키고 싶습니다
새로고침같은 방법말고 좋은 방법좀 알려주세요~~~
부탁드려요 선배님들 ㅠㅠ
댓글 2개
Gaumi
10년 전
음..모르겠네요....
주말에 공부해봐야겠어요..
주말에 공부해봐야겠어요..
mwdkim
10년 전
저도 봐도 모르겠네요 ㅜㅜ ㅎ
게시판 목록
토크
개발과 관련된 어떤 얘기도 괜찮습니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 3601 |
느긋한카키쿠키
|
4일 전 | 3 | |
| 3600 |
nature1235
|
11개월 전 | 437 | |
| 3599 |
swallow
|
2년 전 | 1348 | |
| 3598 |
swallow
|
2년 전 | 1195 | |
| 3597 |
swallow
|
2년 전 | 798 | |
| 3596 | 2년 전 | 1416 | ||
| 3595 | 2년 전 | 695 | ||
| 3594 | 2년 전 | 1413 | ||
| 3593 |
|
3년 전 | 1238 | |
| 3592 |
|
3년 전 | 1572 | |
| 3591 |
|
3년 전 | 1486 | |
| 3590 |
|
3년 전 | 1445 | |
| 3589 |
|
4년 전 | 1244 | |
| 3588 |
|
4년 전 | 1225 | |
| 3587 |
|
4년 전 | 1139 | |
| 3586 |
|
4년 전 | 1373 | |
| 3585 |
|
4년 전 | 1294 | |
| 3584 |
|
4년 전 | 1039 | |
| 3583 |
Arm코리아
|
4년 전 | 1135 | |
| 3582 |
|
4년 전 | 1243 | |
| 3581 |
|
4년 전 | 2199 | |
| 3580 |
|
4년 전 | 1271 | |
| 3579 |
|
4년 전 | 1300 | |
| 3578 |
|
4년 전 | 1534 | |
| 3577 | 4년 전 | 1672 | ||
| 3576 |
|
4년 전 | 1663 | |
| 3575 |
|
4년 전 | 1674 | |
| 3574 |
|
4년 전 | 2093 | |
| 3573 |
|
4년 전 | 1549 | |
| 3572 |
|
4년 전 | 1536 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기