.position()
FuncUnit.prototype.position
position([position] [,timeout] [,success] [,message])
Gets an element's position or waits until the position is a specified value.
// gets the position
F("#foo").position();
// waits until the position is 100, 200
F("#foo").position({top:100, left: 200})
Parameters
-
position
{Object | function()}
OptionalIf provided uses this as a check before continuing to the next action. Or you can provide a function that returns true to continue to the next action.
-
timeout
{Number}
Optionaloverrides FuncUnit.timeout. If provided, the wait will fail if not completed before this timeout.
-
success
{function()}
Optionala callback that will run after this action completes.
-
message
{String}
Optionalif provided, an assertion will be passed when this wait condition completes successfully
Returns
{String | funcUnit}
if the position parameter is provided, returns the funcUnit selector for chaining, otherwise returns the offset of the selector.