By way of an example, here is a 'version' of the Audio Player being used as a plugin: https://initiostar.co.uk/demo/AudioPageHolder/ - this enables it to be seamlessly used across multiple variants.
Within the plugin itself one can scroll down a long list of audio tracks and for each one selected, the player scrolls up to an 'information panel' which contains the audio controls for the audio track and anything else the designer wants to add to that panel. All good so far!
The challenge though is this: if a user scrolls down the main page and clicks on a audio track, in some cases where there is a long list, the info panel is not always in view. The required action is for a double-scroll where the info panel comes in to view AND the main page scrolls to the top too.
The iframe code includes a 'window.parent.scrollTo', but this is not good enough to do the trick.
<iframe src="audioplugin.htm" title="Audio_Player_Plugin" name="audioplugin" width="100%" height="100%" style="border-style:none;" onload="window.parent.scrollTo({ top: 0, left: 0, behavior: 'smooth' });"></iframe>
This version of the Audio Plugin uses a page-within-a-page and not popups to keep it simple; each page is called by its page name and loads with the target "audioholder". Had thought about changing the standard Xara page link to a javascript link and adding a scroll-top, but not convinced this would work either.
@Acorn > normally I can fathom this out, but not this time!
Gary
Bookmarks