/* SJM- This is done to prevent the page from scrolling/jumping vertically when controls are interacted with inside the iFrame */
var theiframe; var myTimerVar;
theiframe = document.getElementById('iframe-pklsim');
theiframe.addEventListener('mouseenter', e => { clearInterval(myTimerVar); disableScroll(); });
theiframe.addEventListener('mouseleave', e => { myTimerVar=setInterval(function(){ enableScroll(); clearInterval(myTimerVar); } ,500); });
function disableScroll() { console.log ("disabling scroll");
// Get the current page scroll position scrollTop = window.pageYOffset || document.documentElement.scrollTop; scrollLeft = window.pageXOffset || document.documentElement.scrollLeft,
//scrollTop=250;
// if any scroll is attempted, set this to the previous value window.onscroll = function() { window.scrollTo(scrollLeft, scrollTop); }; }
function enableScroll() { console.log ("enabling scroll"); window.onscroll = function() {}; }