<script type="text/javascript">
<!--
_d=document;
eval('var document=_d');
var gt = unescape('%3e');
var popup = null;
var over = "Launch Pop-up Navigator";
<!-- //歌單 -->
tips = new Array(28);
songname = new Array(28);
tips[0] = "http://www.pixnet.net/photo/caramels/78981092";
songname[0]="Piece of me";
tips[1] = "http://www.pixnet.net/photo/caramels/78985970";
songname[1]="Gimme more";
tips[2] = "http://www.pixnet.net/photo/caramels/78986399";
songname[2]="Radar";
tips[3] = "http://www.pixnet.net/photo/caramels/78986508";
songname[3]="Break the ice";
tips[4] = "http://www.pixnet.net/photo/caramels/78986628";
songname[4]="Heaven on earth";
tips[5] = "http://www.pixnet.net/photo/caramels/78986769";
songname[5]="Get naked";
tips[6] = "http://www.pixnet.net/photo/caramels/78987152";
songname[6]="Freakshow";
tips[7] = "http://www.pixnet.net/photo/caramels/78988176";
songname[7]="Toy soldier";
tips[8] = "http://www.pixnet.net/photo/caramels/78988262";
songname[8]="Hot as ice";
tips[9] = "http://www.pixnet.net/photo/caramels/78988463";
songname[9]="Ooh ooh baby";
tips[10] = "http://www.pixnet.net/photo/caramels/78988621";
songname[10]="Perfect I over";
tips[11] = "http://www.pixnet.net/photo/caramels/78988722";
songname[11]="Why should I be  sad";
tips[12] = "http://www.pixnet.net/photo/caramels/79304451";
songname[12]="最後的風度";
tips[13] = "http://www.pixnet.net/photo/caramels/79386640";
songname[13]="Candyman";
tips[14] = "http://www.pixnet.net/photo/caramels/79387273";
songname[14]="Mercy on me";
tips[15] = "http://www.pixnet.net/photo/caramels/79387630";
songname[15]="Hurt";
tips[16] = "http://www.pixnet.net/photo/caramels/79388619";
songname[16]="Make me wanna Pray";
tips[17] = "http://www.pixnet.net/photo/caramels/79389642";
songname[17]="Nasty Naughty boy";
tips[18] = "http://www.pixnet.net/photo/caramels/79390358";
songname[18]="Aint No other man";
tips[19] = "http://www.pixnet.net/photo/caramels/80559591";
songname[19]="Everytime";
tips[20] = "http://www.pixnet.net/photo/caramels/80559677";
songname[20]="Toxic";
tips[21] = "http://www.pixnet.net/photo/caramels/80559898";
songname[21]="Slave 4U";
tips[22] = "http://www.pixnet.net/photo/caramels/80560317";
songname[22]="Heart";
tips[23] = "http://www.pixnet.net/photo/caramels/80560722";
songname[23]="Chaotic";
tips[24] = "http://www.pixnet.net/photo/caramels/82869766";
songname[24]="The Thing About Love";
tips[25] = "http://www.pixnet.net/photo/caramels/82870046";
songname[25]="Prelude To A Kiss";
tips[26] = "http://www.pixnet.net/photo/caramels/87286058";
songname[26]="I Got Trouble";
tips[27] = "http://www.pixnet.net/photo/caramels/88629304";
songname[27]="淘汰";
tips[28] = "http://www.pixnet.net/photo/caramels/88633750";
songname[28]="Поздно";

popup = window.open('', 'popupnav', 'Width=500,Height=450,resizable=1,scrollbars=yes,');
if (popup != null) {
if (popup.opener == null) {
}else
{
popup.location.href = "http://www.pixnet.net/album/caramels/13446982";
popup.opener = null;
}
}

menu=10;
temp=new Array(menu);
index=Math.floor(Math.random()*tips.length);
for(i=1;i<=menu;i++){
temp[i]=index;
flag1=0;
while(flag1==0){
index=Math.floor(Math.random()*tips.length);
flag2=0;
for(j=1;j<=i;j++){
if(temp[j]==index){
flag2=1;
}
}
if(flag2==0){
flag1=1;
}
};
document.write("<a href=\"javascript://\" onClick=\"popup=window.open(\'"+tips[index]+"\', \'popupnav\', \'Width=500,Height=450,resizable=1,scrollbars=yes,\');\">"+songname[index]+"</a>");
document.write("<p>"+"</p>");
}
popup.opener = null;
// -->
</script>

 


複製以上的程式碼到後台的部落格版面設計 新增一個版塊
然後填入以上的程式碼
修改以下部分
tips = new Array(18);
代表你有19首歌
songname = new Array(18);
19個歌名
tips[18] = "http://www.pixnet.net/photo/caramels/79390358";
songname[18]="Aint No other man";
第十九首歌的網址與歌名
for(i=1;i<=menu;i++){
menu代表隨機跳出menu首歌可以連結

分享給大家 科科

 
 呵呵
我寫的程式碼

caramels 發表在 痞客邦 PIXNET 留言(1) 人氣()


留言列表 (1)

發表留言
  • 黑糖
  • 看不懂啦
    有需要再問你
    哈 恭喜你阿
    樂得勒