演奏会用アプリ作成で得たTips
複数画面を立ち上げる起動スクリプトが作れる
window.onload = function() { window.open('./heart/index.html', 'heart', 'width=300,height=400,resizable=0,scrollbars=0'); window.open('./hemomanometer/index.html', 'hemomanometer', 'width=450,height=580,resizable=0,scrollbars=0'); window.open('./terop.html', 'terop', 'width=1000,height=150,resizable=0,scrollbars=0'); } <|| こうすると、ブラウザの余計なメニューとか入らないですむ **文字化け防止にmetaタグ >|html| <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>start</title> </head>
時間指定(Sleep)的な処理
setTimeout("show_blocks(4)",1000); setTimeout("show_blocks(5)",3000); setTimeout("show_blocks(6)",5000); setTimeout("show_blocks(7)",6000);
この指定で、
1000ミリ秒後にshow_blocks(4)を呼び出す、
3000ミリ秒後にshow_blocks(5)を呼び出す、
以下同様
という動きになります。
これは非同期というか、
setTimeout自体は書いた順に呼ばれるけれど、
その中で呼び出している関数は時間単位で呼び出されるので、
show_blocks(4)が終わっても終わらなくても、
show_blocks(5)が動き出すようでした。