본문으로 바로가기

#js
[javascript]

function fixEvent2(event) {
 if ( !event.target ) {event.target = event.srcElement || document;}
 if ( event.target.nodeType === 3 ) {event.target = event.target.parentNode;}
 if ( event.pageX == null && event.clientX != null ) {
  var eventDocument = event.target.ownerDocument || document,
    doc = eventDocument.documentElement,
    body = eventDocument.body;

  event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
  event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
  
 }
 warehouse_onoff(event.pageX, event.pageY);
}

function warehouse_onoff(x,y){
 var warehouse = document.getElementById('warehouse');
 //alert(fixEvent('onclick'));
 if (warehouse.style.display=="none")
 {
  warehouse.style.display="block";
  warehouse.style.left = x-150 ;
  warehouse.style.top= y+20 ;
 }else{
  warehouse.style.display="none";
 }
}



[html]
<table border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td align="right">    
    <input type="button" value="연동창고" style="width:80;" onclick="fixEvent2(event);">
    <input type="button" value="닫기" style="width:80;" onClick="self.close()">
   </td>
  </tr>
  </table>


ie10까지 잘됨.