$(function(){ var userList = {}; var groupList = {}; var tGroup = []; var basicPath = document.location.pathname; basicPath = basicPath.substring(0, basicPath.lastIndexOf('/'))+'/'; var $userFrame; window.userList = userList; var runAnalysis = function(){ $.each(groupList,function(idx,val){ val.list = []; }); userList = []; var $content = $('#on_mover .content'); $content.html(''); $.get(basicPath+'b_genList.php',function(rawData){ try{ $html = $(rawData); var cnt =0; var tmpUsers = {}; $html.each(function(idx){ var $this = $(this); if($this.attr('id') == "general_list"){ tmpUsers = $(this); return false; } }); tmpUsers.find("tbody > tr").each(function(idx){ var $this = $(this); var $부대 = $this.children('.i_troop'); var 부대 = $.trim($부대.text()); if(부대 == '-'){ //부대 안탔음! return true; } $부대.remove(); var generalID = parseInt($this.data('general-id')); userList[generalID] = $this; $this.hide(); $content.append($this); }); $('.troopUser').hover(function(){ var $this = $(this); var parent = $this.closest('tr'); var generalID = parseInt($this.data('general-id')); console.log(generalID); var top = parent.offset().top + parent.outerHeight(); $userFrame.css('top',top); userList[generalID].show(); $userFrame.show(); },function(){ var $this = $(this); var parent = $this.closest('tr'); var generalID = parseInt($this.data('general-id')); userList[generalID].hide(); $userFrame.hide(); }); } catch(err){ console.log(err); } }); }; var $frame = $('table:eq(0) td:eq(0)'); $frame.find('br:last').remove(); var $btn = $(''); $btn.click(function(){ runAnalysis(); }); $frame.append($btn); $userFrame = $("
| 이 름 | "+ "통무지 | "+ "자 금 | "+ "군 량 | "+ "도시 | "+ "守 | "+ "병 종 | "+ "병 사 | "+ "훈련 | "+ "사기 | "+ "명 령 | "+ "삭턴 | "+ "턴 | "+ "