안녕하세여 퍼블리셔
선배님들
다름이 아니라 윈도우 리사이즈에 관한 질문인데요
$(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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 32341 | |
| 32339 | |
| 32326 | |
| 32325 | |
| 32322 | |
| 32319 | |
| 32318 | |
| 32316 | |
| 32315 | |
| 32313 | |
| 32312 | |
| 32311 | |
| 32310 | |
| 32304 | |
| 32303 | |
| 32300 | |
| 32293 | |
| 32292 | |
| 32291 | |
| 32285 | |
| 32284 | |
| 32275 | |
| 32271 | |
| 32268 | |
| 32265 | |
| 32261 | |
| 32258 | |
| 32257 | |
| 32255 | |
| 32254 | |
| 32253 | |
| 32251 | |
| 32250 | |
| 32249 | |
| 32247 | |
| 32246 | |
| 32245 | |
| 32244 | |
| 32243 | |
| 32242 | |
| 32241 | |
| 32240 | |
| 32239 | |
| 32238 | |
| 32237 | |
| 32236 | |
| 32232 | |
| 32229 | |
| 32228 | |
| 32227 | |
| 32217 | |
| 32215 | |
| 32214 | |
| 32213 | |
| 32211 | |
| 32207 | |
| 32196 | |
| 32193 | |
| 32192 | |
| 32190 | |
| 32188 | |
| 32186 | |
| 32184 | |
| 32173 | |
| 32172 | |
| 32171 | |
| 32167 | |
| 32165 | |
| 32163 | |
| 32162 | |
| 32158 | |
| 32157 | |
| 32155 | |
| 32151 | |
| 32149 | |
| 32135 | |
| 32132 | |
| 32127 | |
| 32125 | |
| 32122 | |
| 32120 | |
| 32119 | |
| 32117 | |
| 32116 | |
| 32115 | |
| 32114 | |
| 32112 | |
| 32111 | |
| 32109 | |
| 32107 | |
| 32104 | |
| 32103 | |
| 32102 | |
| 32101 | |
| 32094 | |
| 32089 | |
| 20404 | |
| 31036 | |
| 8279 | |
| 8268 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기