在页面的头部加上代码。如果页面被嵌,top指的是父页面的window。window为当前页面的window对象。 转载于:https://www.cnblogs.com/justinwxt/p/9431189.html