| リンクボタンサウンド付 カスタマイズ方法 赤字削除変更不可、青字設定箇所、グレーは必要のない部分(解説)です。 音を鳴らす際は、イベントハンドラの onclick="" を使用しています。
<HTML XMLNS:t="urn:schemas-microsoft-com:time">
<HEAD> <TITLE>ボタンサウンド付き</TITLE> <STYLE type="text/css"> .time{behavior: url(#default#time2);} DIV{position:absolute;top:-120;left:0;} INPUT{position:absolute;text-align:center;width:120;top:0;left:0;} </STYLE>
</HEAD>
サンプル以外のものも少し用意しました。音の長さがサンプルと異なります。 落下や、飛来する時間を変更してください。
<BODY> <BGSOUND id="fly" src="" loop=3><BGSOUND id="fly2" src="" loop=5> <EMBED src="click.wav" autostart="false" hidden="true">
<INPUT id="bt0" type="button" value="MENU OPEN" style="position:relative;top:0;left:-10;" onclick="fly2.src='click.wav'">
<DIV id="bt1"> <INPUT id="bt1_0" type="button" value="CLICK!!" style="z-index:1;" onclick="fly.src='click.wav'"> <INPUT id="bt1_1" type="button" onclick="location='#'" value="Sub1"> <INPUT id="bt1_2" type="button" onclick="location='#'" value="Sub2"> <INPUT id="bt1_3" type="button" onclick="location='#'" value="Sub3"></DIV>
<t:animateMotion targetElement="bt1_1" begin="bt1_0.click" values="-360,-360;120,0;120,0" dur="0.2" autoreverse="false" fill="hold" /> <t:animateMotion targetElement="bt1_2" begin="bt1_0.click+.2" values="-360,-240;240,0;240,0" dur="0.2" autoreverse="false" fill="hold" /> <t:animateMotion targetElement="bt1_3" begin="bt1_0.click+.4" values="-360,-120;360,0;360,0" dur="0.2" autoreverse="false" fill="hold" />
<DIV id=bt2> <INPUT id="bt2_0" type="button" value="CLICK!!" style="z-index:1;" onclick="fly.src='click.wav'"> <INPUT id="bt2_1" type="button" onclick="location='#'" value="Sub1"> <INPUT id="bt2_2" type="button" onclick="location='#'" value="Sub2"> <INPUT id="bt2_3" type="button" onclick="location='#'" value="Sub3"></DIV> <t:animateMotion targetElement="bt2_1" begin="bt2_0.click" values="800,-360;120,0;120,0" dur="0.2" autoreverse="false" fill="hold" /> <t:animateMotion targetElement="bt2_2" begin="bt2_0.click+.2" values="800,-240;240,0;240,0" dur="0.2" autoreverse="false" fill="hold" /> <t:animateMotion targetElement="bt2_3" begin="bt2_0.click+.4" values="800,-120;360,0;360,0" dur="0.2" autoreverse="false" fill="hold" /> <DIV id=bt3> <INPUT id="bt3_0" type="button" value="CLICK!!" style="z-index:1;" onclick="fly.src='click.wav'"> <INPUT id="bt3_1" type="button" onclick="location='#'" value="Sub1"> <INPUT id="bt3_2" type="button" onclick="location='#'" value="Sub2"> <INPUT id="bt3_3" type="button" onclick="location='#'" value="Sub3"></DIV> <t:animateMotion targetElement="bt3_1" begin="bt3_0.click" values="-120,1200;120,0;120,0" dur="0.2" autoreverse="false" fill="hold" /> <t:animateMotion targetElement="bt3_2" begin="bt3_0.click+.2" values="-120,1200;240,0;240,0" dur="0.2" autoreverse="false" fill="hold" /> <t:animateMotion targetElement="bt3_3" begin="bt3_0.click+.4" values="-120,1200;360,0;360,0" dur="0.2" autoreverse="false" fill="hold" /> <DIV id=bt4> <INPUT id="bt4_0" type="button" value="CLICK!!" style="z-index:1;" onclick="fly.src='click.wav'"> <INPUT id="bt4_1" type="button" onclick="location='#'" value="Sub1"> <INPUT id="bt4_2" type="button" onclick="location='#'" value="Sub2"> <INPUT id="bt4_3" type="button" onclick="location='#'" value="Sub3"></DIV> <t:animateMotion targetElement="bt4_1" begin="bt4_0.click" values="800,1200;120,0;120,0" dur="0.2" autoreverse="false" fill="hold" /> <t:animateMotion targetElement="bt4_2" begin="bt4_0.click+.2" values="800,1200;240,0;240,0" dur="0.2" autoreverse="false" fill="hold" /> <t:animateMotion targetElement="bt4_3" begin="bt4_0.click+.4" values="800,1200;360,0;360,0" dur="0.2" autoreverse="false" fill="hold" /> <DIV id=bt5> <INPUT id="bt5_0" type="button" value="CLICK!!" style="z-index:1;" onclick="fly.src='click.wav'"> <INPUT id="bt5_1" type="button" onclick="location='#'" value="Sub1"> <INPUT id="bt5_2" type="button" onclick="location='#'" value="Sub2"> <INPUT id="bt5_3" type="button" onclick="location='#'" value="Sub3"></DIV> <t:animateMotion targetElement="bt5_1" begin="bt5_0.click" values="-120,-360;120,0;120,0" dur="0.2" autoreverse="false" fill="hold" /> <t:animateMotion targetElement="bt5_2" begin="bt5_0.click+.2" values="-120,-240;240,0;240,0" dur="0.2" autoreverse="false" fill="hold" /> <t:animateMotion targetElement="bt5_3" begin="bt5_0.click+.4" values="-120,-120;360,0;360,0" dur="0.2" autoreverse="false" fill="hold" /> <t:animate id="t0" targetElement="bt1" attributeName="top" from="0" to="70" begin="t1.end" dur=".2" fill="hold" /> <t:animate id="t1" targetElement="bt2" attributeName="top" from="0" to="100" begin="t2.end" dur=".2" fill="hold" /> <t:animate id="t2" targetElement="bt3" attributeName="top" from="0" to="130" begin="t3.end" dur=".2" fill="hold" /> <t:animate id="t3" targetElement="bt4" attributeName="top" from="0" to="160" begin="t4.end" dur=".2" fill="hold" /> <t:animate id="t4" targetElement="bt5" attributeName="top" from="0" to="190" begin="bt0.click" dur=".2" fill="hold" /> </BODY> </HTML> |