componentFromPoint 简单实例

Syntax

sScrollComponent = object.componentFromPoint(iCoordX, iCoordY)


Parameters

iCoordXRequired. Integer that specifies the client window coordinate of x.
iCoordYRequired. Integer that specifies the client window coordinate of y.




Return Value

empty stringComponent is inside the client area of the object.
outsideComponent is outside the bounds of the object.
scrollbarDownDown scroll arrow is at the specified location.
scrollbarHThumbHorizontal scroll thumb or box is at the specified location.
scrollbarLeftLeft scroll arrow is at the specified location.
scrollbarPageDownPage-down scroll bar shaft is at the specified location.
scrollbarPageLeftPage-left scroll bar shaft is at the specified location.
scrollbarPageRightPage-right scroll bar shaft is at the specified location.
scrollbarPageUpPage-up scroll bar shaft is at the specified location.
scrollbarRightRight scroll arrow is at the specified location.
scrollbarUpUp scroll arrow is at the specified location.
scrollbarVThumbVertical scroll thumb or box is at the specified location.
handleBottomBottom sizing handle is at the specified location.
handleBottomLeftLower-left sizing handle is at the specified location.
handleBottomRightLower-right sizing handle is at the specified location.
handleLeftLeft sizing handle is at the specified location.
handleRightRight sizing handle is at the specified location.
handleTopTop sizing handle is at the specified location.
handleTopLeftUpper-left sizing handle is at the specified location.
handleTopRightUpper-right sizing handle is at the specified location.



<HTML>
<HEAD>
<SCRIPT>
/*When this function is activated, an alert pops up displays the component at the position of the pointer. */

function ComponentSnapShot(){
	var sElem = "";
	sElem = document.body.componentFromPoint(event.clientX,event.clientY);

	if (sElem=="")
	alert("No component there!");
	else
	alert("Component: " + sElem);
}
</SCRIPT>



</HEAD>
<!-- There are several different events that can be used with componentFromPoint. Below are a few of them.
Be carefull! Not all mouse events can be used with componentFromPoint.  -->
<BODY  οnmοusedοwn="ComponentSnapShot()" οncοntextmenu="ComponentSnapShot()">

<TEXTAREA COLS=500 ROWS=500>
This text forces scroll bars to appear in the window.
</TEXTAREA>
</BODY>
</HTML>



:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值