側邊加入迷你水族箱

忘了是從何處知悉這個水族箱的網站了,今天改寫了一下程式,依進入首頁時的秒數來顯示不同的水族
箱,總共有十種不同的水族箱或魚群。雖然改寫了程式,但仍保留原有的連結,應該是沒有侵犯到該網站的智慧財產權吧 :-) Xuite的自由欄位怪怪的,若有興趣則請至http://blog.yam.com/emisjerry看範例。

程式在後,請將全形的小於換成半形的小於後,加入自由/插入欄位。

<script>

var d = new Date();

var s = d.getSeconds();

var aFishes = ["mini_neon","mini_neon2","mini_neon3","mini_neon4",

"mini_platinum","mini_discus","mini_discus2",

"mini_clown","mini_clown2","mini_clown3"];

var iType= s %
(aFishes.length);

thefile=aFishes[iType];

document.write(thefile);

if (typeof(ma_BackgroundColor) =="undefined") ma_BackgroundColor =
"#444444";

if (typeof(ma_FishNum) =="undefined") ma_FishNum = "2";

var plugin = (navigator.mimeTypes &&
navigator.mimeTypes["application/x-director"]) ?
navigator.mimeTypes["application/x-director"].enabledPlugin : 0;

if( plugin ){

var words
= navigator.plugins["Shockwave for Director"].description.split(" ");

for (var
i = 0; i < words.length; ++i)

{

if
(isNaN(parseInt(words[i])))

continue;

var
swPluginVersion =parseFloat(words[i]);

}

var swCanPlay = swPluginVersion
>= 8.5;

} else if (navigator.userAgent &&
navigator.userAgent.indexOf("MSIE")>=0 &&
(navigator.userAgent.indexOf("Windows 95")>=0 ||
navigator.userAgent.indexOf("Windows 98")>=0 ||
navigator.userAgent.indexOf("Windows NT")>=0 )) {

var tVersionString = "";

document.write('<SCRIPT
LANGUAGE=VBScript> n');

document.write('on error resume next
n');

document.write('set tSWControl =
CreateObject("SWCtl.SWCtl") n');

document.write('if IsObject(tSWControl)
then n');

document.write('tVersionString =
tSWControl.ShockwaveVersion("") n');

document.write('end if');

document.write('</SCRIPT> n');

if (tVersionString != "") {

tVersionIndex = tVersionString.indexOf(".")

var
tMajorVersionString = tVersionString.substring(tVersionIndex-2,
tVersionIndex);

var
tMinorVersionString = tVersionString.substring(tVersionIndex+1,
tVersionIndex+2);

if
(parseInt(tMajorVersionString) > 8) {

swCanPlay
= 1;

}else if
(parseInt(tMajorVersionString) == 8) {

if (tMinorVersion > 0) {

if
(parseInt(tMinorVersionString) >= 5) {

swCanPlay
= 1;

}

} else {

swCanPlay
= 1;

}

}

}

}

if(swCanPlay){

document.write('<object
classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"');

document.write('
codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,0,0"');

document.write(' ID=miniaqua width=140 height=130><param
name=src value="http://m-aqua.com/'+thefile+'.dcr">');

document.write("<param name=swRemote value="swSaveEnabled='false'
swVolume='false' swRestart='false' swPausePlay='false'
swFastForward='false' swContextMenu='true' ">");

document.write('<param name=swStretchStyle value=meet><PARAM
NAME=bgColor VALUE='+ma_BackgroundColor+'><PARAM NAME=sw1
VALUE='+ma_BackgroundColor+'><PARAM NAME=sw2
VALUE='+ma_FishNum+'>');

document.write('<PARAM NAME=logo VALUE=FALSE><PARAM
NAME=swStretchHAlign VALUE=Center><PARAM NAME=swStretchVAlign
VALUE=Center>');

document.write("<embed src="http://m-aqua.com/"+thefile+".dcr"
bgColor="+ma_BackgroundColor+" sw1="+ma_BackgroundColor+"
sw2="+ma_FishNum+" logo=FALSE swStretchHAlign=Center
swStretchVAlign=Center width=140 height=130
swRemote="swSaveEnabled='false' swVolume='false' swRestart='false'
swPausePlay='false' swFastForward='false' swContextMenu='true' "
swStretchStyle=meet type="application/x-director"
pluginspage="http://www.macromedia.com/shockwave/download/">
</embed></object>");

}else{

document.write('<img src="http://m-aqua.com/img/noplugin4.gif" alt=""
width="140" height="130" border="0" usemap="#miniaquaMap3">');

document.write('<map name="miniaquaMap3"><area shape="rect"
coords="7,86,127,101"
href="http://www.macromedia.com/jp/shockwave/download/index.cgi?Lang=Japanese&P1_Prod_Version=Shockwave"
target="_blank">');

document.write('<area shape="rect" coords="52,42,114,58"
href="http://m-aqua.com/miniaqua.html" target="_blank"><area
shape="rect" coords="0,102,140,130"
href="http://www.accesstrade.net/at/c.html?rk=01000w7n000y1z"
target="_blank"></map>');

}

</script>

##

您可能也會有興趣的類似文章

簡睿

服務於軟體業的資訊老兵。興趣廣泛,學習力佳,樂於分享所知所學。

您可能也會喜歡…

3 個回應

  1. Spooky表示:

    還是沒辦法 ( 欄位透明、只有標題 >

  2. 簡睿表示:

    那用右鍵→檢視原始檔, 找到黃框中的程式後, 由標示到,複製再剪貼到您的自由欄位裡。

  3. Spooky表示:

    真糟糕,我不管怎麼用都失敗,不曉得是發生什麼問題。>< (我明明就有把小於都改了呀?)            

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *