#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";
}
}
<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까지 잘됨.
'웹프로그래밍 > Javascript' 카테고리의 다른 글
오브젝트의 속성값 가져오기 (0) | 2013.11.13 |
---|---|
자바스크립트 ie10 체크 (0) | 2013.05.27 |
jquery 이펙트 반복실행에 따른 구분 처리 - 슬라이드메뉴 (0) | 2013.02.21 |
[자바스크립트] 테이블 tr td 추가 삭제 (0) | 2012.10.26 |
[JAVASCRIPT] 자바스크립트 숫자표시->금액표시(3째자리 콤마) (0) | 2012.10.26 |