사이드뷰 스크립트에 focus 이벤트 추가

This commit is contained in:
chicpro
2013-02-01 10:53:45 +09:00
parent c7c0cdea13
commit 91ad8cd88d
2 changed files with 27 additions and 6 deletions

View File

@ -571,9 +571,10 @@ $(function(){
// 사이드뷰
var sv_hide = false;
$('.sv_wrap').addClass('sv_off');
$('.sv').click(function() {
$('.sv_member, .sv_guest').click(function() {
$('.sv_wrap').removeClass('sv_on').addClass('sv_off');
$(this).find('.sv_wrap').removeClass('sv_off').addClass('sv_on');
$(this).closest('.sv').find('.sv_wrap').removeClass('sv_off').addClass('sv_on');
});
$('.sv, .sv_wrap').hover(
@ -585,7 +586,27 @@ $(function(){
}
);
$('html').click(function() {
$('.sv_member, .sv_guest').focusin(function() {
sv_hide = false;
$('.sv_wrap').removeClass('sv_on').addClass('sv_off');
$(this).closest('.sv').find('.sv_wrap').removeClass('sv_off').addClass('sv_on');
});
$('.sv_wrap a').focusin(function() {
sv_hide = false;
});
$('.sv_wrap a').focusout(function() {
sv_hide = true;
});
$(document).click(function() {
if(sv_hide) {
$('.sv_wrap').removeClass('sv_on').addClass('sv_off');
}
});
$(document).focusin(function() {
if(sv_hide) {
$('.sv_wrap').removeClass('sv_on').addClass('sv_off');
}