Commit afabcb6e authored by zjz1994's avatar zjz1994

iframe暂存

parent 82ef94e3
...@@ -143,7 +143,7 @@ export default class MapScene extends Scene { ...@@ -143,7 +143,7 @@ export default class MapScene extends Scene {
this.islongScreen = true; this.islongScreen = true;
} }
// this.islongScreen = false; // this.islongScreen = false;
// console.log("手机长短屏幕适配",whl,this.islongScreen); console.log("手机长短屏幕适配",whl,this.islongScreen);
if(this.islongScreen){ if(this.islongScreen){
this['adapttop'].y = 50; this['adapttop'].y = 50;
this['settingsx'].bottom = 50; this['settingsx'].bottom = 50;
......
...@@ -43,6 +43,7 @@ export default class WebView extends egret.DisplayObjectContainer { ...@@ -43,6 +43,7 @@ export default class WebView extends egret.DisplayObjectContainer {
public constructor(){ public constructor(){
super(); super();
var stageDelegateDom:HTMLElement = document.getElementById("StageDelegateDiv"); var stageDelegateDom:HTMLElement = document.getElementById("StageDelegateDiv");
console.log("缩放比例",stageDelegateDom.style.transform);
var body = document.body; var body = document.body;
// stageDelegateDom.style.width="100%"; // stageDelegateDom.style.width="100%";
// stageDelegateDom.style.height="100%"; // stageDelegateDom.style.height="100%";
...@@ -74,6 +75,11 @@ export default class WebView extends egret.DisplayObjectContainer { ...@@ -74,6 +75,11 @@ export default class WebView extends egret.DisplayObjectContainer {
this._windowW=Number(stageDelegateDom.clientWidth); this._windowW=Number(stageDelegateDom.clientWidth);
this._windowH=Number(stageDelegateDom.clientHeight); this._windowH=Number(stageDelegateDom.clientHeight);
var whl = body.clientWidth/body.clientHeight;
var islongScreen = whl>0.5?false:true;
console.log("webview长短屏幕适配",whl,islongScreen);
this._iframe.width = this._iframeWrapper.style.width = body.clientWidth*3+"px"; this._iframe.width = this._iframeWrapper.style.width = body.clientWidth*3+"px";
this._iframe.height = this._iframeWrapper.style.height = body.clientHeight*3+"px"; this._iframe.height = this._iframeWrapper.style.height = body.clientHeight*3+"px";
// this._iframe.width = this._iframeWrapper.style.width = this._windowW+"px"; // this._iframe.width = this._iframeWrapper.style.width = this._windowW+"px";
...@@ -102,6 +108,10 @@ export default class WebView extends egret.DisplayObjectContainer { ...@@ -102,6 +108,10 @@ export default class WebView extends egret.DisplayObjectContainer {
if(this.nshowurl&&this.nshowurl==src){ if(this.nshowurl&&this.nshowurl==src){
}else{ }else{
this._iframe.contentWindow.onload = function(){
// console.log("iframe_title",this._iframe.contentWindow.document.title);
console.log("iframe_onload_title",this);
}
this._iframe.src = ""; this._iframe.src = "";
this.nshowurl = src; this.nshowurl = src;
this._iframe.src=src; this._iframe.src=src;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment