mouse move 이벤트 전에는 mouseover 이벤트 작동하지 않도록 수정

This commit is contained in:
chicpro
2013-02-15 09:16:41 +09:00
parent 7149579496
commit 3867034f3d

View File

@ -22,13 +22,16 @@ if (!defined('_GNUBOARD_')) exit;
<script>
$(function(){
var hide_menu = false;
var mouse_move = false;
// 주메뉴
var $gnb = $('.gnb_1depth > a');
$gnb.mouseover(function() {
$('.gnb_1depth').removeClass('gnb_1depth_over gnb_1depth_on');
$(this).parent().addClass('gnb_1depth_over gnb_1depth_on');
hide_menu = false;
if(mouse_move) {
$('.gnb_1depth').removeClass('gnb_1depth_over gnb_1depth_on');
$(this).parent().addClass('gnb_1depth_over gnb_1depth_on');
hide_menu = false;
}
});
$gnb.mouseout(function() {
@ -43,6 +46,10 @@ $(function(){
hide_menu = true;
});
$(document).mousemove(function(e) {
mouse_move = true;
});
$gnb.focusin(function() {
$('.gnb_1depth').removeClass('gnb_1depth_over gnb_1depth_on');
$(this).parent().addClass('gnb_1depth_over gnb_1depth_on');