157
Views
4
Comments
Resizing container detection.
Application Type
Reactive
Service Studio Version
11.53.8 (Build 60995)

Hi All,

I want to run an action whenever my Container changes its dimension (width and height).

Is there any JS that I need to run. Kindly suggest something.

2018-05-15 08-41-11
Davide Periquito

Hey Saransh,


Not really sure if I got you.


But you can do this 

  1. On Ready action for the screen add a javascript node with the following JS code:
  2. window.addEventListener('resize', function(event) {    $actions.Action1()}, true);
  3. build a client action with the logic that you need and replace the action1() by your action name

Hope I could help.


UserImage.jpg
Saransh

Hi Davide thanks for responding let me check this.

2020-10-02 21-47-41
Samuel Nunes Marques

Following Davide's answer, you could use the Resize Observer API, witch has some advantages over the  convencional window.addEventListener.

UserImage.jpg
Saransh

Okay let me go through this.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.