웹마스터 팁
히든프레임 사랑비BGM 컨트롤하기(수정완료)
2008.11.16 17:03
히든 프레임으로 사랑비 BGM을 사용할 때 제로보드 레이아웃에서 사랑비 BGM 플레이어를 컨트롤 하는 '리모컨'입니다.
parent.frames['bgm'] 부분의 bgm을 사랑비 bgm 플레이어 프레임 이름으로 바꿔 주시면됩니다.
<frame name=bgm src=./bgm/sarangbi_bgm.php noresize> 이런식일때 사용하시면 됩니다.
예제 링크 : http://pwnet.kr
추가적으로 생성한 오브젝트가 3개 있습니다.
1. mintime :: 현재 재생중인 시간을 표시하는 레이어. 기본상태 00:00
2. maxtime :: 현재 음악의 총 재생 시간을 표시하는 레이어. 기본상태 00:00
3. mu 폼의 mus 인풋박스 :: 사랑비 플레이어의 메시지를 표시하는 텍스트 박스
<!-- Sarangbi BGM Frame Controller -->
<div class="blogTitleBox">
<h2>PWnet BGM (<span id=mintime>00:00</span>/<span id=maxtime>00:00</span>)</h2>
</div>
<div class="widgetBox" align=center>
<!--<marquee scrollamount="5" behavior=alternate><span id=msglayer><h2 style="color:#00afcf;">Loading...</h2></span></marquee>-->
<form name=mu><input name=mus size=24 style="font-size:8pt;color:#00afcf;"></form>
<a onclick="parent.frames['bgm'].method_PreviousButtonPush();" onMouseOver="document.pre.src='http://pwnet.kr/bgm/skin/tomboy/button/back_over.gif';" onMouseOut="document.pre.src='http://pwnet.kr/bgm/skin/tomboy/button/back.gif';"><img name=pre src="http://pwnet.kr/bgm/skin/tomboy/button/back.gif" width="13" height="13" border="0" alt="이전"></a>
<a onclick="parent.frames['bgm'].method_PlayButtonPush();" onMouseOver="document.pla.src='http://pwnet.kr/bgm/skin/tomboy/button/play_over.gif';" onMouseOut="document.pla.src='+ '+ 'http://pwnet.kr/bgm/skin/tomboy/button/play.gif';"><img name=pla src="http://pwnet.kr/bgm/skin/tomboy/button/play.gif" width="13 " height="13" border="0" alt="재생"></a>
<a onclick="parent.frames['bgm'].method_NextButtonPush();" onMouseOver="document.nex.src='http://pwnet.kr/bgm/skin/tomboy/button/forward_over.gif';" onMouseOut="document.nex.src='http://pwnet.kr/bgm/skin/tomboy/button/forward.gif';"><img name=nex src="http://pwnet.kr/bgm/skin/tomboy/button/forward.gif" width="13" height="13" border="0" alt="다음"></a>
<a onclick="parent.frames['bgm'].method_PauseButtonPush();" onMouseOver="document.pau.src='http://pwnet.kr/bgm/skin/tomboy/button/pause_over.gif';" onMouseOut="document.pau.src='http://pwnet.kr/bgm/skin/tomboy/button/pause.gif';"><img name=pau src="http://pwnet.kr/bgm/skin/tomboy/button/pause.gif" width="13 " height=" 13" border="0" alt="잠시멈춤"></a>
<a onclick="parent.frames['bgm'].method_StopButtonPush();" onMouseOver="document.sto.src='http://pwnet.kr/bgm/skin/tomboy/button/stop_over.gif';" onMouseOut="document.sto.src='+ 'http://pwnet.kr/bgm/skin/tomboy/button/stop.gif';"><img name=sto src="http://pwnet.kr/bgm/skin/tomboy/button/stop.gif" width="13" height="13" border="0" alt="정지"></a>
<a onclick="parent.frames['bgm'].method_VolumnUpButtonPush();" onMouseOver="document.volup.src='+ 'http://pwnet.kr/bgm/skin/tomboy/button/volume_up_over.gif';" onMouseOut="document.volup.src='http://pwnet.kr/bgm/skin/tomboy/button/volume_up.gif';"><img name=volup src="http://pwnet.kr/bgm/skin/tomboy/button/volume_up.gif" width="13" height="13" border="0" alt="소리 +"></a>
<a onclick="parent.frames['bgm'].method_VolumnDownButtonPush();" onMouseOver="document.voldn.src='http://pwnet.kr/bgm/skin/tomboy/button/volume_down_over.gif';" onMouseOut="document.voldn.src='http://pwnet.kr/bgm/skin/tomboy/button/volume_down.gif';"><img name=voldn src="http://pwnet.kr/bgm/skin/tomboy/button/volume_down.gif" width="13" height="13" border="0" alt="소리 -"></a>
<a onclick="parent.frames['bgm'].method_BGMListButtonPush();" onMouseOver="document.lis.src='http://pwnet.kr/bgm/skin/tomboy/button/list_over.gif';" onMouseOut="document.lis.src='http://pwnet.kr/bgm/skin/tomboy/button/list.gif';"><img name=lis src="http://pwnet.kr/bgm/skin/tomboy/button/list.gif" width="13" height="13" border="0" alt="플레이리스트"></a>
<!--@if($logged_info->is_admin == 'Y')-->
<a onclick="parent.frames['bgm'].method_SetupButtonPush();" onMouseOver="document.adm.src='http://pwnet.kr/bgm/skin/tomboy/button/admin_over.gif';" onMouseOut="document.adm.src='http://pwnet.kr/bgm/skin/tomboy/button/admin.gif';"><img name=adm src="http://pwnet.kr/bgm/skin/tomboy/button/admin.gif" width="13" height="13" border="0" alt="관리자페이지"></a> </div><!--@end-->
sarangbi_bgm.js 수정내용
// 웹브라우저 상태창에 출력
function private_Browser_Status( msg)
{
if( invar_use_Browser_Status)
{
if( msg == '::SARANGBI BGM::')
window.defaultStatus = msg;
else
window.defaultStatus = '[배경 음악] ' + msg;
try {
parent.frames['main'].mu.mus.value = msg;}
catch(exception) {
}
}}
// 시간 표시 함수
function private_time()
{
total_time=Math.floor( document.Sarangbi_Bgm.Duration);
cur_time=Math.floor( document.Sarangbi_Bgm.currentPosition);
if( invar_Error > 0){
if( invar_Error <= 3){
private_subject_show(11);
invar_Error++;
}else
method_NextButtonPush();
}else
if( invar_Buffring == true)
private_subject_show(6);
else{
invar_total_min=Math.floor( total_time/60);
invar_total_sec=total_time - invar_total_min*60;
invar_cur_min=Math.floor( cur_time/60);
invar_cur_sec=cur_time - invar_cur_min*60;
if( invar_total_min < 10) invar_total_min = "0" + invar_total_min;
if( invar_total_sec < 10) invar_total_sec = "0" + invar_total_sec;
if( invar_cur_min < 10) invar_cur_min = "0" + invar_cur_min;
if( invar_cur_sec < 10) invar_cur_sec = "0" + invar_cur_sec;
if( private_GetMediaState() == 2 && invar_use_Browser_Status) window.defaultStatus = '+
'[배경 음악] ' + invar_MusicTitle[invar_CurrentTrack] + " (" + invar_cur_min + ":" + invar_cur_sec + ")";
if( invar_alltime_show) document.all.sarangbi_bgm_alltime.innerHTML = invar_total_min + ":" + invar_total_sec;
if( invar_curtime_show) document.all.sarangbi_bgm_curtime.innerHTML = invar_cur_min + ":" + invar_cur_sec;
private_Browser_Status(invar_MusicTitle[invar_CurrentTrack]);
try {
parent.frames['main'].mintime.innerHTML = invar_cur_min + ':' + invar_cur_sec;
parent.frames['main'].maxtime.innerHTML = invar_total_min + ':' + invar_total_min;
} catch(exception) {
}
}}
sarangbi_bgm.php 부분에
// 음악 리스트 출력 함수
function bgm_list()
{
global $img_list, $img_list_over, $list_alt, $blend, $blend_time, $skin_dir, $list_width, $list_height, $list_one_music_height, $invar_use_frame, $invar_list_frame, $num_list;
if( $img_list == '')
missing_img('Music List 출력');
else{
echo "<script language=javascript>
function method_BGMListButtonPush()
{
if( $invar_use_frame){
$invar_list_frame.location.href='http://pwnet.kr/bgm/sarangbi_bgm_list.php';
}else{
var w = $list_width;
var h = $list_height;
var sw = window.screen.availWidth;
var sh = window.screen.availHeight;
if( invar_MusicCount > $num_list)
h+=$list_one_music_height*$num_list;
else
h+=$list_one_music_height*invar_MusicCount;
var sarangbi_bgm_list=window.open('http://pwnet.kr/bgm/sarangbi_bgm_list.php','Sarangbi_BGM_MusicList','scrollbars=yes,resizable=yes,width='+w+',height='+h);
sarangbi_bgm_list.moveTo((sw - w) / 2, (sh - h) / 2);
}
}
function bgmlist_over(){
if( $blend)
bt('sarangbi_bgm_list_image', '$skin_dir$img_list_over');
else
sarangbi_bgm_list_image.src="$skin_dir$img_list_over";
private_btn_status('$list_alt');
}
function bgmlist_out(){
if( $blend)
bt('sarangbi_bgm_list_image', '$skin_dir$img_list');
else
sarangbi_bgm_list_image.src="$skin_dir$img_list";
}
document.write("<img id='sarangbi_bgm_list_image' src='$skin_dir$img_list' onmouseover='bgmlist_over();' onmouseout='bgmlist_out();' style='cursor:hand; filter:blendTrans(duration=$blend_time);' alt='$list_alt' onClick='method_BGMListButtonPush();'>");n</script>nn";
}
}
// pause 버튼 출력 함수 (다음곡 play)
function bgm_admin()
{
global $img_admin, $img_admin_over, $admin_alt, $skin_dir, $blend, $blend_time;
if( $img_admin == '')
missing_img('사랑비 BGM 관리 도구 출력');
else{
echo "<script language=javascript>
function method_SetupButtonPush()
{
var w = 620;
var h = 620;
var sw = window.screen.availWidth;
var sh = window.screen.availHeight;
var sarangbi_setup=window.open('http://pwnet.kr/bgm/sarangbi_bgm_admin.php','Sarangbi_BGM_Setup','scrollbars=yes, resizable=yes,width='+w+',height='+h);
sarangbi_setup.moveTo((sw - w) / 2, (sh - h) / 2);
}
function bgmadmin_over(){
if( $blend)
bt('sarangbi_bgm_admin_image', '$skin_dir$img_admin_over');
else
sarangbi_bgm_admin_image.src="$skin_dir$img_admin_over";
private_btn_status('$admin_alt');
}
function bgmadmin_out(){
if( $blend)
bt('sarangbi_bgm_admin_image', '$skin_dir$img_admin');
else
sarangbi_bgm_admin_image.src="$skin_dir$img_admin";
}
document.write("<img id='sarangbi_bgm_admin_image' src='$skin_dir$img_admin' onmouseover='bgmadmin_over();' onmouseout='bgmadmin_out();' style='cursor:hand; filter:blendTrans(duration=$blend_time);' alt='$admin_alt' onClick='method_SetupButtonPush();'>");n</script>nn";
}
}
댓글 6
제목 | 글쓴이 | 날짜 |
---|---|---|
글쓰기를 클릭하면 띄워지는 테두리 없는 예쁜 팝업 띄우기 core. 1.7.4 [4] | 마음의빈자리 | 2014.02.11 |
2014년 2월 12일부터 갑자기 사이트(관리자 페이지)가 깨지는 경우. | 새하나모 | 2014.02.12 |
이메일인증 Error 한방정리 참고해보세요. [4] | 애드바이러스 | 2014.02.12 |
css 배경이미지 정리 | devdevpia | 2014.02.13 |
GNB 메뉴를 쉽게 만드는 jQuery plugin [2] | 김개발 | 2014.02.14 |
css 가운데정렬 완벽정리! | 돼지코구뇽 | 2014.02.14 |
"이 페이지 나가기" 경고창이 뜨는 사이트의 경우 [23] | 투씨 | 2014.02.15 |
카카오스토리 링크 [14] | 맞장 | 2014.02.15 |
우분투 12.04 LTS Nginx 최신버전 설치하기 [1] | 도라미 | 2014.02.17 |
1.7.4 용 youtube, vimeo, ted 썸네일 적용 document.item.php 수정방법 [9] | 남자인간 | 2014.02.17 |
1.7.4 버전용 한글 lang.xml 파일 [5] | 투씨 | 2014.02.18 |
IEXPLORER 버젼 호환성 강제 맞추기 | davidis | 2014.02.18 |
누리고 쇼핑몰 모바일버전에서 백지화현상 수정하는 팁 [5] | garnecia | 2014.02.19 |
XE 1.7.4 "이메일 주소로 계정 찾기" 오류 해결 방법 | 꿈돌리 | 2014.02.20 |
위젯 게시판 선택시 다중선택하기 ! [2] | GomSang | 2014.02.21 |
게시판 목록에서 새창 띄워서 다른 형태 나오게 하기 [3] | foret | 2014.02.23 |
게시판 목록의 new 아이콘 바꾸기 [1] | foret | 2014.02.23 |
스케치북5 모바일 댓글 작성시 엔터를 쳤을 때 <br /> 코드 뜨는 문제 해결 [7] | oryan | 2014.02.23 |
코어 수정 없이 스킨 수정만으로 게시판 목록에 유튜브,비메오 썸네일 출력 [2] | foret | 2014.02.23 |
부트스트랩 레이아웃 제작시 메뉴 코딩팁 | 웹빌드 | 2014.02.23 |