Package com.oorian.messaging.commands
Class ScrollIntoView
java.lang.Object
com.oorian.messaging.commands.Command
com.oorian.messaging.commands.JavaScriptCommand
com.oorian.messaging.commands.ScrollIntoView
Command that scrolls a specified element into the visible area of the browser window.
This command executes the browser's native scrollIntoView() method on the
target element, bringing it into view with the specified alignment.
-
Constructor Summary
ConstructorsConstructorDescriptionScrollIntoView(Element element, String align) Creates a ScrollIntoView command for the specified element.ScrollIntoView(String elementId, String align) Creates a ScrollIntoView command for the element with the specified ID. -
Method Summary
Methods inherited from class com.oorian.messaging.commands.JavaScriptCommand
toJsonMethods inherited from class com.oorian.messaging.commands.Command
getElementId, getId, setElementId, toString
-
Constructor Details
-
ScrollIntoView
Creates a ScrollIntoView command for the specified element.- Parameters:
element- the element to scroll into viewalign- the scroll alignment (e.g., "true" for top, "false" for bottom, or a JSON options object like "{behavior: 'smooth'}")
-
ScrollIntoView
Creates a ScrollIntoView command for the element with the specified ID.- Parameters:
elementId- the ID of the element to scroll into viewalign- the scroll alignment (e.g., "true" for top, "false" for bottom, or a JSON options object like "{behavior: 'smooth'}")
-