有了這個效果不需要再為每一張圖片製作一個頁面,可以再每一張圖片連結設定開啟視窗的大小, 且有按圖片關閉視窗的功能,用於展示賀圖或PHOTO都是不錯的效果。
<HEAD>與</HEAD>之間
<script type="text/javascript">
<!--
function opennewwindow(javampicture,windowparameters){
newwindow=window.open("","newone", windowparameters);
newwindow.document.write ("<html><head>");
newwindow.document.write ("<title>Picture</title>");
newwindow.document.write ("</head><body style='margin:0px'>");
newwindow.document.write ("<a href='javascript:this.close()'><img src=");
newwindow.document.write (javampicture);
newwindow.document.write (" border='0' alt='CLOSE'");
newwindow.document.write ("></a>");
newwindow.document.write ("</body></html>");
newwindow.document.close();
return false;
}
// -->
</script>
<BODY>與</BODY>之間
✦步驟二 opennewwindow('photo.jpg' // 新視窗裡的圖片
✦menubar=0 // 視窗是否應用選項 1/0
✦scrollbars=0 // 視窗是否捲軸 1/0
✦toolbar=0 // 視窗是否要否工具列 1/0
✦width=220 // 視窗寬度
✦height=190 // 視窗高度
✦<img src="photo.jpg" border="0"> //縮圖設定
✦自行增加步驟二的動作,設定每一個圖顯示在不同大小的視窗
留言列表