Jump to content

iFrame scrolling options


Recommended Posts

Hello @CoopperBackpack

You need to use some additional JS to handle the scroll
This code needs to be inserted in the Header of the DataPage you  open  through the link:

<script type="text/javascript">
document.addEventListener('DataPageReady', scrollHandler)

function scrollHandler(event) {
 parent.postMessage('scrollHandler', '*');
 document.removeEventListener('DataPageReady', scrollHandler)
};
</script>

This code needs to be placed in your CMS system before the deploy code of the DataPage:

<script>
	window.addEventListener("message", receiveMessage, false);

	function receiveMessage(event){		
		if (event.data === 'scrollHandler') {
			window.scroll(0, 0);
		}		
	}
</script>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...