사이드뷰 스크립트에 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');
}

View File

@ -958,7 +958,7 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
$tmp_name = "";
if ($mb_id) {
$tmp_name = "<span class=\"sv_member\">$name</span>";
$tmp_name = "<a href=\"#\" class=\"sv_member\">$name</a>";
if ($config['cf_use_member_icon']) {
$mb_dir = substr($mb_id,0,2);
@ -971,13 +971,13 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
$tmp_name = '<img src="'.$icon_file_url.'" width="'.$width.'" height="'.$height.'" border="0" alt="">';
if ($config['cf_use_member_icon'] == 2) // 회원아이콘+이름
$tmp_name = $tmp_name . ' <span class="sv_member">'.$name.'</span>';
$tmp_name = $tmp_name . ' <a href="#" class="sv_member">'.$name.'</a>';
}
}
$title_mb_id = '['.$mb_id.']';
} else {
$tmp_name = '<span class="sv_guest">'.$name.'</span>';
$tmp_name = '<a href="#" class="sv_guest">'.$name.'</a>';
$title_mb_id = '[비회원]';
}