danny 2007-12-7 10:13
Java Script的影片切換
[size=12px][color=#a52a2a]<DIV align=center>
<SCRIPT language=javascript>
<!--
{
}
<!-- 判 斷 IE 或 Netscape -->
var bWin32IE;
if ((navigator.userAgent.indexOf("IE") != "-1") && (navigator.userAgent.length > 1)) {
bWin32IE = true;
} else {
bWin32IE = false;
}
<!-- Media Player 控 制 功 能 -->
function setasxfile1 (playtitle) {
MM_showHideLayers('Layer2','','hide','Layer3','','show');
if (bWin32IE == true) {
NSPlay.stop();
NSPlay.autoStar = true;
NSPlay.Filename = playtitle;
} else {
document.NSPlay.stop();
document.NSPlay.SetAutoStart(true);
document.NSPlay.SetFileName(playtitle);
}
}
function start(){
if (bWin32IE == true) {
NSPlay.CurrentPosition = 0;
NSPlay.play();
} else {
document.NSPlay.SetCurrentPosition(0);
document.NSplay.Play();
}
}
function pause(){
MM_showHideLayers('Layer2','','show','Layer3','','hide');
if (bWin32IE == true) {
NSPlay.CurrentPosition = 0;
NSPlay.stop();
} else {
document.NSPlay.SetCurrentPosition(0);
document.NSplay.Pause();
}
}
function stop(){
MM_showHideLayers('Layer2','','show','Layer3','','hide');
if (bWin32IE == true) {
NSPlay.stop();
} else {
document.NSplay.Stop();
document.NSPlay.SetCurrentPosition(0);
}
}
<!--
//
var version="other"
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3) version = "n3";
else if (browserName == "Netscape" && browserVer < 3) version = "n2";
else if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) version = "e4";
else if (browserName == "Microsoft Internet Explorer" && browserVer < 4) version = "e3";
//-->
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</SCRIPT>
<OBJECT id=NSPlay classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95
align=middle width=320 height=240><PARAM NAME="AudioStream" value="-1"><PARAM NAME="FileName" value="[url=http://home.kimo.com.tw/hot_912000/01.js%22%3E%3CPARAM][color=#0000ff]http://home.kimo.com.tw/hot_912000/01.js"><PARAM[/color][/url] NAME="BufferingTime" value="0"><PARAM NAME="CaptioningID" value=""><PARAM NAME="PlayCount" value="1"><PARAM NAME="PreviewMode" value="0"><PARAM NAME="Rate" value="1"><PARAM NAME="loop" value="-1"><PARAM NAME="EnableContextMenu" value="0"><PARAM NAME="ShowCaptioning" value="0"><PARAM NAME="ShowControls" value="0"><PARAM NAME="ShowAudioControls" value="0"><PARAM NAME="ShowDisplay" value="0"><PARAM NAME="ShowGotoBar" value="0"><PARAM NAME="ShowPositionControls" value="0"><PARAM NAME="ShowStatusBar" value="-1"><PARAM NAME="ShowTracker" value="0"><PARAM NAME="TransparentAtStart" value="0"><PARAM NAME="VideoBorderWidth" value="0"><PARAM NAME="VideoBorderColor" value="0"><PARAM NAME="VideoBorder3D" value="-1"><PARAM NAME="Volume" value="-520"><PARAM NAME="WindowlessVideo" value="0">
<embed
width="320" height="240" src="" autosize="0"
autostart="-1" animati
baseurl="" clicktoplay="1"
enablec enablepositi
enablefullscreenc enabletracker="0"
filename="" sendopenstatechangeevents="1"
sendplaystatechangeevents="1" showc
showaudioc showdisplay="0"
showgotobar="0" showpositi
showstatusbar="0" showtracker="0"
transparentatstart="-1" volume="2"
windowlessvideo="0"> </embed> </OBJECT>
<form name=selectform action="" method=post><SELECT
style="COLOR: white; BACKGROUND-COLOR: #000000"
onchange=setasxfile1(document.selectform.channel.options[document.selectform.channel.selectedIndex].value);
align=center name=channel> <OPTION selected>------------ M T V 觀 賞
------------</OPTION>
<option style="TEXT-DECORATION: none" value="連結網址">檔案名稱</option>
<option style="TEXT-DECORATION: none" value="連結網址">檔案名稱</option>
<option style="TEXT-DECORATION: none" value="連結網址">檔案名稱</option>
<option style="TEXT-DECORATION: none" value="連結網址">檔案名稱</option>
<option style="TEXT-DECORATION: none" value="連結網址">檔案名稱</option>
<option style="TEXT-DECORATION: none" value="連結網址">檔案名稱</option>
<option style="TEXT-DECORATION: none" value="連結網址">檔案名稱</option>
<option style="TEXT-DECORATION: none" value="連結網址">檔案名稱</option>
</SELECT>
</form></DIV>
[/color]
[color=#0000ff]選單式MTV語法
將上列程式複製到<BODY></BODY>之中
PS.連結的網址&名稱部分請自己更改[/color]
[/size]