Page 1 of 1

Posting a message from a Child page to its parent

Posted: Sun Aug 14, 2016 7:53 am
by alex4orly
Hello all,

I have a page here - this is the PARENT page : http://www.beleuramyhome.org.au/videoclips.html
It has a Layout grid with 2 columns
In the RHS column is an iFrame, The iFrame loads into itself a CHILD page which has in it a Blog Object
The Blog object has in it many entries, and the visitor scrolls down to click on a button, by that time - the Viewer which resides in the LHS of the PARENT page is already out of sight.
I want to force the click to execute 2 things onto the PARENT page
1) Make the link of the new video clip into the viewer, AND
2) Force the PARENT page to scroll back into view top of page
This can be better seen on a mobile phone - where the problem manifest itself

I have seen some suggestion of using a windows=>postmessage from the click in the blog into the PARENT but have no idea how to go about it

Hope somebody here can help me
Thanks

Re: Posting a message from a Child page to its parent

Posted: Sun Aug 14, 2016 10:20 am
by BaconFries
Forum rules
This section is to share tips, tricks and tutorials related to WYSIWYG Web Builder.
Please do not post questions or problems here. They will not be answered.

Re: Posting a message from a Child page to its parent

Posted: Mon Aug 15, 2016 12:52 am
by alex4orly
BaconFries wrote:Forum rules
This section is to share tips, tricks and tutorials related to WYSIWYG Web Builder.
Please do not post questions or problems here. They will not be answered.
OOPS... unintentional, didn't notice into which forum I am posting.
BUT - to pay for my Sin, I RESOLVED this as follows, and offer to share it as my trick contribution

In the CHILD page, where the Blog object is:
Open the Events tab, click Add and Add 2 events. For both - chose OnClick, for both chose Java Script
In this order - insert
1) window.parent.scrollTo(0, 0);
2) return true;

Upon clicking the selected Blog option, it loads the respective URL into the viewer, and scrolls the browser back to the top of the page... Easy... (after I found a hint at w3schools.com)

Hope some else can find this useful