Hi,
We have embedded charity payment provider into our wix web page but we have a small issues with UX. When user completes first step and clicks NEXT button, content of the iframe changes but user remains on the bottom of the page. On mobile this creates a state when user sees only white screen unless he scrolls top.
I'm looking for an option to trigger scroll to the top when button is pressed or when content of an iframe is changed. Content of an iframe is being loaded in random amount of time, depends on the equipment, is there any way to wait for content to be resolved and hook to what is displayed on the screen? Or is there any way to trigger scroll even when certain API call is made? I would like to note that while content of the iframe feed from src link is changing page itself doesn't refresh. Thanks in advance for all the answers!
@Vest Rivian I understand what you are doing.
Refer to the articles that I linked to for how to communicate (message passing) with the code in the HtmlComponent.
You can set an anchor at the top of the page, and when you receive the appropriate message from your Html script, you can scrollTo() the anchor.
Again, it is highly recommended to use the REST interface if available.
Also, if possible, a more secure way to handle web service requests is by using backend (server-side) code. Using backend code you can secure your passwords, API keys, and other secret information. The article Accessing 3rd Party Services explains how this is done. I recommend checking with the service provider to see if they provide a REST interface.
Using this method, you will also have more control of the site's UX.
Adding code to an HTML component is not a part of the Corvid product (which is what this forum is about). The basics of an HTML component is to put any HTML code in it. That code can be copied from any source that you want, but you need to know the exact code to put there (which is not related to Corvid).
Refer to the HtmlComponent API documentation for more information. Look at the article Corvid: Working with the HTML Element for an explanation on how to use.
Here are a couple of examples that demonstrate how to use an HtmlComponent:
Example: Fullscreen with HtmlComponent
Example: Multiple Markers Google Maps
For the script itself, you will need to check with the service provider to find out how to get it work.