Tip: Controlling widgets inside iframe from the outside and vice versa


#1

Hi!

Iframes can be handy in certain situations, but they are limiting since Axure doesn’t let you communicate with objects inside of the iframe from the outside or vice versa. However, you can do this using Axure’s javascript API.

Attached is a file that has several examples of communicating in each direction.

Live sample

File:


Control Prototype from Inline Frame External Content by evaluating the URL?
Automatic height of Inline Frame
#2

Many thanks, just what I was looking for! :slight_smile:


#3

I’m trying to use your example in RP7, everything works except the iFrame resize, any thoughts?
RP8 is currently not an option for me as I’m having page loading issues due to speed.


#4

Attaching simple examples to show the problem.

Using inspect, it seems the style tag is not being set in the rp7 version.

Shrink iFrame RP7.rp (57.1 KB)Shrink iFrame RP8.rp (55.3 KB)


#5

Hi!

The resize() function does not exist in the Axure 7 API - probably because the only resizable thing in 7 was dynamic panels. Instead you’ll need to use straight up javascript. This will resize an iframe called “testFrame” to 1000,1000.

$(’[data-label=“testFrame”]’).width(1000).height(1000)


#6

That’s perfect, many thanks!
It’s so obvious when you look at the syntax, wood/trees :slight_smile:


#7

Hi @josephxbrick ,
Thank you for a very useful tip, its just what I need atm. Could you please reupload the Axure file so I can learn how it works? The download link is missing.

Edit: I already found your file in other post, thanks!


unlisted #8

closed #9