Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // PARENT WINDOW
- (function () {
- function scrollWindow(evt) {
- var message;
- if (evt.origin !== "iframe_URL_HERE" ) {
- message = "Action cannnot be performed";
- } else {
- var x = evt.data.xAxis || 0;
- var y = evt.data.yAxis || 0;
- window.scrollTo(x,y);
- }
- }
- if (window.addEventListener) {
- // For standards-compliant web browsers
- window.addEventListener("message", scrollWindow, false);
- } else {
- window.attachEvent("onmessage", scrollWindow);
- }
- }());
Add Comment
Please, Sign In to add comment