CoopperBackpack Posted May 12, 2020 Report Share Posted May 12, 2020 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. Quote Link to comment Share on other sites More sharing options...
Hastur Posted May 12, 2020 Report Share Posted May 12, 2020 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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.