ポップアップさせた HTML の「コンテンツ領域」サイズと、ウインドウ全体(外形)サイズとの、
ブラウザごと(ていうても、3種類だけしか試してないのですけど、... 。)の差分サイズを
実地検証するためのテスト実験企画であります。
IE(Microsoft Internet-Explorer)では、一部うまく動かない?!ところがあったり?しますが、
まぁ、ほぼ、前回記事のとおりで、「キレイに」開くんではないか、と。。。。
<input type='range'>タグ(アメブロでは「禁止タグ」ですけど、・・)が
「つまみ(レバー)」で表示される環境なら、ウインドウがウニウニするのを体験できます。
アメブロ版は、ポップアップはするけれど、なぜか??動作機能いたしません!m(_ _)m
正式HTML版 を使ってください。。。
<div class='itemsKiji'>HTML を <button onclick="fnPup();">ポップアップ</button></div>
<div class='itemsKiji'>
<label class='Kiji' for='Wd'>コンテンツ幅</label><input type='range' value='384' min='192' max='768' step='16' title='384' id='Wd'></div>
<div class='itemsKiji'>
<label class='Kiji' for='Ht'>コンテンツ高</label><input type='range' value='192' min='96' max='640' step='16' title='192' id='Ht'></div>
</div>
<div class='itemsKiji'>
<label class='Kiji' for='Wd'>コンテンツ幅</label><input type='range' value='384' min='192' max='768' step='16' title='384' id='Wd'></div>
<div class='itemsKiji'>
<label class='Kiji' for='Ht'>コンテンツ高</label><input type='range' value='192' min='96' max='640' step='16' title='192' id='Ht'></div>
</div>
// スクリプト、ここから。
if((typeof Sz)==='undefined'){
// サイズ基本構造体(アメブロ用簡易版).
function Sz(nW, nH){
this.width=(!nW)?0:parseInt(nW);
this.height=(!nH)?0:parseInt(nH);
this.getSz=function(){return new Sz(this.width, this.height);};
this.setSz=function(sz){
this.width=sz.width; this.height=sz.height; return this.getSz();
};
this.toString=function(){return 'width:'+this.width+';height:'+this.height+';';};
}
} // if(typeof Sz).
// オブジェクト等.
var oWnd=null;
var ElmCntn;
var SzPpCntn1st=new Sz(384,192);
// ポップアップ!
var fnPup=function(){ oWnd=window.open('https://bit.ly/2CItHj4', 'WND123OPN', 'width=384,height=192,menubar=no,toolbar=no,scrollbars=no,status=no,location=no,resizable=yes,dialog=yes,chrome=yes');
};
// ポップアップのコンテンツ幅を変える.
var ElmWd=document.getElementById('Wd');
ElmWd.oninput=function(ev){var elm=ev.target;
if(!ElmCntn) ElmCntn=(!oWnd)?null: oWnd.document.getElementById('content');
if(ElmCntn){ElmCntn.style.width=elm.value+'px';
oWnd.fnGetCntnSz();
oWnd.fnReSzTo();
elm.title=elm.value;
}
};
// ポップアップのコンテンツ高を変える.
var ElmHt=document.getElementById('Ht');
ElmHt.oninput=function(ev){var elm=ev.target;
if(!ElmCntn) ElmCntn=(!oWnd)?null: oWnd.document.getElementById('content');
if(ElmCntn){ElmCntn.style.height=elm.value+'px';
oWnd.fnGetCntnSz();
oWnd.fnReSzTo();
elm.title=elm.value;
}
};
// スクリプト、ここまで。
if((typeof Sz)==='undefined'){
// サイズ基本構造体(アメブロ用簡易版).
function Sz(nW, nH){
this.width=(!nW)?0:parseInt(nW);
this.height=(!nH)?0:parseInt(nH);
this.getSz=function(){return new Sz(this.width, this.height);};
this.setSz=function(sz){
this.width=sz.width; this.height=sz.height; return this.getSz();
};
this.toString=function(){return 'width:'+this.width+';height:'+this.height+';';};
}
} // if(typeof Sz).
// オブジェクト等.
var oWnd=null;
var ElmCntn;
var SzPpCntn1st=new Sz(384,192);
// ポップアップ!
var fnPup=function(){ oWnd=window.open('https://bit.ly/2CItHj4', 'WND123OPN', 'width=384,height=192,menubar=no,toolbar=no,scrollbars=no,status=no,location=no,resizable=yes,dialog=yes,chrome=yes');
};
// ポップアップのコンテンツ幅を変える.
var ElmWd=document.getElementById('Wd');
ElmWd.oninput=function(ev){var elm=ev.target;
if(!ElmCntn) ElmCntn=(!oWnd)?null: oWnd.document.getElementById('content');
if(ElmCntn){ElmCntn.style.width=elm.value+'px';
oWnd.fnGetCntnSz();
oWnd.fnReSzTo();
elm.title=elm.value;
}
};
// ポップアップのコンテンツ高を変える.
var ElmHt=document.getElementById('Ht');
ElmHt.oninput=function(ev){var elm=ev.target;
if(!ElmCntn) ElmCntn=(!oWnd)?null: oWnd.document.getElementById('content');
if(ElmCntn){ElmCntn.style.height=elm.value+'px';
oWnd.fnGetCntnSz();
oWnd.fnReSzTo();
elm.title=elm.value;
}
};
// スクリプト、ここまで。
※HTML版は、→ コチラ
。