asp.net.ph

Skip Navigation Links

componentFromPoint Method

DHTML Methods


Returns the component located at the specified coordinates.

Syntax

sScrollComponent = object.componentFromPoint ( 
   iCoordX, iCoordY ) 
Parameters

iCoordX Required. Specifies the client window coordinate of x.
iCoordY Required. Specifies the client window coordinate of y.

Return Value

String. Possible return values include:

"" The component is inside the client area of the object.
outside The component is outside the bounds of the object.
scrollbarDown The down scroll arrow is at the specified location.
scrollbarHThumb The horizontal scroll thumb or box is at the specified location.
scrollbarLeft The left scroll arrow is at the specified location.
scrollbarPageDown The page-down scroll bar shaft is at the specified location.
scrollbarPageLeft The page-left scroll bar shaft is at the specified location.
scrollbarPageRight The page-right scroll bar shaft is at the specified location.
scrollbarPageUp The page-up scroll bar shaft is at the specified location.
scrollbarRight The right scroll arrow is at the specified location.
scrollbarUp The up scroll arrow is at the specified location.
scrollbarVThumb The vertical scroll thumb or box is at the specified location.

Remarks

The componentFromPoint method is applicable to any object that can be given scroll bars through cascading style sheets ( CSS ).

The componentFromPoint method may not consistently return the same object when used with the onmouseover event. Because a user's mouse speed and entry point varies, different components of an element fire the onmouseover event.

For example, when a user moves the mouse cursor over a TEXTAREA object with scroll bars, the event may fire when the mouse enters the component border, the scroll bars, or the client region. Once the event has fired, the expected element may not be returned unless the scroll bars were the point of entry for the mouse. In this case, the onmousemove event can be used to provide more consistent results.

Example

The example employs the componentFromPoint method to determine what object the mouse is hovering over.

Sample Code


Applies To

BODY, DIV, SPAN, TEXTAREA

See Also

doScroll, onScroll



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note