웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
링크 클릭시 사운드 효과
2003.04.09 19:56
링크 클릭시 사운드 효과입니다.
온클릭과 온마우스오버 다 가능합니다.
<style type="text/css">
<!--
A:link {color:444444;text-decoration:none;}
A:visited {color:444444;text-decoration:none;}
A:active {color:444444;text-decoration:none;}
A:hover {color:444444;text-decoration:none;}
-->
</style>
<script LANGUAGE="JavaScript">
<!--
var ButtonSound = new Array();
ButtonSound[0] = "1.wav"; //사운드 파일의 경로
ButtonSound[1] = "2.wav"; //사운드 파일의 경로
ButtonSound[2] = "3.wav"; //사운드 파일의 경로
document.write('<BGSOUND ID="alertsound">')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;
function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}
var Str = '';
for (i=0;i<ButtonSound.length;i++)
Str += "<EMBED SRC='"+ButtonSound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.alertsound:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? ButtonSound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}
function musicplay(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
//-->
</script>
<a href="#" onmouseover="musicplay(0)">아햏햏</a>,
<a href="#" onClick="musicplay(1)">스타쉬피스</a>,
<a href="#" onClick="musicplay(2)">뚫흙뚫흙</a>,
온클릭과 온마우스오버 다 가능합니다.
<style type="text/css">
<!--
A:link {color:444444;text-decoration:none;}
A:visited {color:444444;text-decoration:none;}
A:active {color:444444;text-decoration:none;}
A:hover {color:444444;text-decoration:none;}
-->
</style>
<script LANGUAGE="JavaScript">
<!--
var ButtonSound = new Array();
ButtonSound[0] = "1.wav"; //사운드 파일의 경로
ButtonSound[1] = "2.wav"; //사운드 파일의 경로
ButtonSound[2] = "3.wav"; //사운드 파일의 경로
document.write('<BGSOUND ID="alertsound">')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;
function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}
var Str = '';
for (i=0;i<ButtonSound.length;i++)
Str += "<EMBED SRC='"+ButtonSound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.alertsound:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? ButtonSound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}
function musicplay(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
//-->
</script>
<a href="#" onmouseover="musicplay(0)">아햏햏</a>,
<a href="#" onClick="musicplay(1)">스타쉬피스</a>,
<a href="#" onClick="musicplay(2)">뚫흙뚫흙</a>,
댓글 3
-
#피터팬증후군
2004.06.24 00:38
-
이영준
2003.04.28 01:03
헤더부분에 넣어는데 에러가....쩝 -
규민
2008.12.20 13:55
추천하고 스크랩합니다~ㅋㅋ;
추천 꾸욱!