• ベストアンサー

サブウィンドウを常に最前面に表示する

Blackwinglsの回答

回答No.2

こんばんわぁ、Blackwinglsです。 私は親Window側に <body onBlur="blur()"> と記述して実現していますが・・・・・ フレーム使っているとNGです。 さらに、ブラウザ以外の物にも立ち上がっていると反応してしまいます(^^;) もっと上手い方法があれば良いんですけどねぇ。 ではでは(@^^)/~~~

関連するQ&A

  • ブラウザサイズをフルサイズで表示させる方法

    ブラウザにタイトルバーとスクロールバーとスタートバー以外を表示しないページを作成したいのですが、 XPはOKで、WIN98でうまくいきませんでした。リンク先をクリックすると別ウィンドウが立ち上がる仕組みです。画面サイズに合わせて変わるようなのですが、WIN98では、スクロールバーが途中で切れてしまい、 一番下まで、綺麗に表示できませんでした。これ以外の方法でもかまいませんので、どなたかご伝授いただければと思います。 function wopen(url){ if(screen.width <= 640){ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=640,height=480,left=0,top=0") }elseif(screen.width <= 800){ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=800,height=600,left=0,top=0") }else if(screen.width <= 1024){ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=1024,height=768,left=0,top=0") }else if(screen.width <= 1152){ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=1152,height=864,left=0,top=0") }else if(screen.width <= 1280){ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=1280,height=1024,left=0,top=0") }else{ window.open(url,"_blank","resizable=no,menubar=no,status=yes,location=no,scrollbars=yes,toolbar=no,width=1600,height=1240,left=0,top=0") } return; } : <A href="javascript:wopen('/index.html')">

  • サブウィンドウに変数を渡す方法・・・

    ブウィンドウを開く時に親ウィンドウからフォームの値を変数として渡し スプリクトを実行したいのですがやり方が解りません。 どなたか教えて頂けませんでしょうか? 下記のソースだとうまくいきません newWin = window.open("xxx.php3","SubWindow","left=400,top=100,width=300,height=400");

  • 常に中央に表示できますか?

    JavaScriptで小窓を表示させています。 <script language="JavaScript"> <!-- function open01(){window.open"stop.htm","01", "toolbar=0,location=0,directories=0,status=1, menubar=0,scrollbars=0,resizable=0,top=250, left=240,width=300,height=100");} //--> </script> 上のようにtopとleftを指定してwindowを画面の中央に 表示するようにしたのですが、中央に表示されるのは 800x600ピクセルの場合で、1024x768ピクセルだと中央 からずれてしまいます。どの解像度でも中央に表示する 方法はありますか?

  • 中央に小窓表示

    とあるサイトで中央に小窓表示JavaScriptを使用し Another HTML-lint gatewayで文法チェックしたら XHTMLでは <SCRIPT> や <STYLE> の内容が #PCDATA です。コメントはコメントとして解釈されてしまうので、旧来のテクニックは使えません。外部にスクリプトファイルやスタイルファイルを用意するようにしましょう。 とでました 下記のJavaScriptを外部形式にするにはxxx.jsに書くところまではわかりましたが書き方がわかりませんどこを変更したらいいのでしょうか <script type="text/javascript"><!-- function m_win(url,windowname,width,height) { var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no"; if (width) { if (window.screen.width > width) features+=", left="+(window.screen.width-width)/2; else width=window.screen.width; features+=", width="+width; } if (height) { if (window.screen.height > height) features+=", top="+(window.screen.height-height)/2; else height=window.screen.height; features+=", height="+height; } window.open(url,windowname,features); } // --></script> よろしくお願いします

  • 外部JSでサブウィンドウを設定する場合

    サブウィンドウの設定についてご質問いたします。 親ウィンドウの中の画像をクリックしてサブウィンドウを開くと言う設定をしたいのです。 親ウィンドウにある画像は2つでそれぞれ開くサブウィンドウの大きさは異なります。 まずsample.jsを作り function subopen1(){ window.open("××.html","subwin1", "width=450,height=450,toolbar=no,scrollbars=no,left=15,top=5") } function subopen2(){ window.open("××.html","subwin2", "width=500,height=450,toolbar=no,scrollbars=no,left=15,top=5"); } と記述しました。 そして<HEAD>~</HEAD>に <script type="text/javascript" src="sample.js"></script> 続いて<BODY>~</BODY>には <A href="javascript:subopen1()"><IMG src="××1.gif" width="100" height="120" alt="Click"></A> <A href="javascript:subopen2()"><IMG src="××2.gif" width="100" height="120" alt="Click"></A> と記述したのですが 「オブジェクトを指定して下さい」とエラー表示され実行出来ません。 上記に修正箇所があったら教えて下さい。 又別な方法でも構いませんのでサブウィンドウの設定が出来れば教えて頂きたいと思います。 どうか宜しくお願い致します。ペコ↓m(_ _;)m↓ペコ

  • サブウィンドウがリロードされたとき、手前に表示したい

    <a href= "a1.htm"onClick="window.open 'a1.htm','new','width=600,height=500,scrollbars=1,resizable=1'); return false;"> でサブウィンドウを開いています。 開いた状態で、また親ウィンドウから、別の(a2.htm)ファイルを開きます。同じサブウィンドウで表示されるのですが、親ウィンドウが手前でサブウィンドウが変わったのがわかりません。 サブウィンドウのファイルが変わったときに、 親ウィンドウの手前に表示させることは可能でしょうか?

  • Javascriptでサブウィンドウを指定した位置に表示したい

    Javascript経験者です。 Javascriptでサブウィンドウを、親ウィンドウの位置より任意の座標分移動した位置に表示するプログラムを考えています。 winX = window.screenLeft + 100; winY = window.screenTop + 100; function openImg() { window.open("***.JPG","winName","scrollbars=no,resizable=no,width=200,height=160,left=winX,top=winY"); 上記にて設定したwinX、winYにはサブウィンドウを表示させたい位置座標が入っているのが確認できたのですが、実際に動かしてみると、サブウィンドウは(x,y)=(0,0)の位置に表示されてしまいます。 初歩的なミスなのかもしれませんが、どこに欠陥があるかわからなくて質問させていただきました。 よろしくお願いいたします。

  • 別画面表示に関して

    教えて下さい。 今回、IE環境で使っていたプログラムを、新しくGoogle Chrome で動作させたところ、 javascript で別画面表示させているwindow.open が別タブとなってしまいました。 以下のような記述をしていますが、Google Chromeの場合、何か特別な事が必要なのでしょうか? 《記述内容》 <script> function window_open(){ window.open("about:blank","window_name","width=640,height=480,scrollbars=yes,menubar=yes,toolbar=yes,status=yes,directories=yes,location=yes,titlebar=yes"); document.fod.target = "window_name"; document.fod.method = "POST"; document.fod.action="XXX.php"; } </script> onclickイベントで上記の場所へ飛ぶようにしてあります。 初歩的な事かもしれませんが、教えて下さい。 よろしくお願いします。

  • ポップアップウィンドウを画面中央に配置+複数リンクを同じウインドウに表示させたい

    過去にあった複数のイベント等の写真をスライドショーで紹介するページを作成中です。 ひとつのページ上に複数リンクがあって、それぞれクリックするとポップアプウィンドウが画面中央で開くようにすることはできました。(下記参照) <script type="text/javascript"> <!-- function win(url,windowname,width,height) { var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no"; if (width) { if (window.screen.width > width) features+=", left="+(window.screen.width-width)/2; else width=window.screen.width; features+=", width="+width; } if (height) { if (window.screen.height > height) features+=", top="+(window.screen.height-height)/2; else height=window.screen.height; features+=", height="+height; } window.open(url,windowname,features); } // --></script> body内 <a href="link_page.htm"onclick="win(this.href,null,600,430); return false;"><img src="image.gif" width="123" height="18" /></a></td> ただ複数あるリンクをクリックすると、ポップアップウィンドウも次々増えてしまうのを、常にひとつのウインドウ上に表示させることができません。 どうぞご指南よろしくお願いします!

  • サブウィンドウに背景色をつけたいのですが・・・

    今仕事でホームページを初めて作成しています。 そこで、30秒程度したら自動的に消えるサブウィンドウを作成したのですが、背景色がぜんぜんつきません。 いったいどこに、背景色のスクリプトを表示したらいいのですか。教えてください。 初心者でわからないので、全部のせてしまいました・・・ 要領わるくてすいません。 function createSubWindow() { subWindow = window.open("","SubWindow","width=370,height=220"); subWindow.document.writeln("<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=Shift_JIS'>"); subWindow.document.writeln("<HTML>"); subWindow.document.writeln("<HEAD>"); subWindow.document.writeln("<TITLE>Whata's New?</TITLE>"); subWindow.document.writeln("<SCRIPT LANGUAGE='JavaScript'>"); subWindow.document.writeln("<!--"); subWindow.document.writeln("function setTimer() {"); subWindow.document.writeln("window.setTimeout('window.close()', 30 * 1000);"); subWindow.document.writeln("}"); subWindow.document.write ("//--"); subWindow.document.writeln(">"); subWindow.document.writeln("</SCRIPT>"); subWindow.document.writeln("</HEAD>"); subWindow.document.writeln("<BODY onLoad='setTimer()'>"); subWindow.document.writeln("</BODY>"); subWindow.document.writeln("</HTML>"); subWindow.document.close(); } function closeSubWindow() { if(!subWindow.closed) { subWindow.close(); } } //--> </SCRIPT>