Message Boards Message Boards

Back

How to target a particular layout using onLayoutChange

Toggle
Hi,

I am trying to change the font scale specifically for a phone layout.

I see there is a action block for "onLayoutChange" but I cannot see a way to target a specific layout - e.g. `If layout is "Phone Portrait" then scale = 50`

Many thanks in advance for any help given.
0 (0 Votes)

RE: How to target a particular layout using onLayoutChange
Answer
1/16/24 5:24 PM as a reply to Leon R.
Hi Leon,
This is possible... sort of. I'm not sure I would recommend it, though. See attached image. Basically, WHEN the layout changes, you can get the name of the new layout. But if the learner starts viewing the lesson in Phone Portrait Layout, then the onLayoutChange Event never happens, right? And onPageChange doesn't pass this same event. So it's not very reliable for this purpose.

Instead, I'd recommend 2 separate text objects that have the same text in them, but at your desired sizes, and place the one you don't want off screen (when in Phone-Portrait-Layout have the Phone-Portrait-text on the page, and the Default-Layout-text offscreen, and vice versa).

Hope that helps!
0 (0 Votes)