每進入此頁或是按重新整理,即會隨機顯示資料夾內的圖片達到變換效果

<BODY>與</BODY>之間

<script type="text/javascript">
<!--
ImageCount = 4;
img = Math.floor(Math.random() * ImageCount);
document.write("<img src='photo/"+img+".jpg'>");
// -->
</script> 

 

✦ImageCount = 4; //圖案張數
✦<img src='photo/"+img+".jpg'>
✦photo/為放圖檔的資料夾,要自己建立(圖片檔名必須以0.jpg、1.jpg、2.jpg、3.jpg、以此類推...),jpg為圖片格式

 

arrow
arrow
    全站熱搜

    Bonnie✦ 發表在 痞客邦 留言(0) 人氣()