Search.../

onPressOut( )

Adds an event handler that runs when an element on a mobile app is released after being pressed.

Description

A mobile element receives an event when a mobile app user presses on the element and then releases.

Syntax

function onPressOut(handler: EventHandler): MobileElement
handler: function EventHandler(event: Event): void

onPressOut Parameters

NAME
TYPE
DESCRIPTION
handler

The name of the function or the function expression to run when an element on a mobile app is released after being pressed.

Returns

The mobile element to which the event handler was added.

Return Type:

EventHandler Parameters

NAME
TYPE
DESCRIPTION
event

The event that occurred.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

Get the ID of the mobile button immediately when an element is released

Copy Code
1$w('#mobileButton1').onPressOut( (event) => {
2 let targetId = event.target.id; // 'mobileButton1'
3} );
Change the mobile button's label immediately when the button is released

Copy Code
1$w('mobileButton1').onPressOut((event) => {
2 $w('#mobileButton1').label = 'Order Now';
3});