Jump to content

Recommended Posts

Hello,

I have deployed my DataPages using the iFrame deployment method. And now I have an issue with my CMS system because of the iFrames.

When I go through the link, the scroll needs to go up but it still in the same place.

How can I fix this?

Thank you in advance. 

Link to post
Share on other sites

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 post
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...