Nerdrium Home

Macintosh

Linux

Web Design

Case Mods

Gardening

Photography

Recipes

 

My Blog

 

Facebook

Twitter

Formatting and Displaying Photos

Page 4

Now, before I continue, let me point out that this whole thing started as a quick hack to post some pictures quickly. If you want to add text to the picture pages, or have user comments, or whatever, you need something more along the lines of Gallery.

That said, below is the code for my little picture window web page.

<html>
<head>
<title>My Photos </title>
<script language="javascript">
function createWindow(image) {
var args='width=700,height=525,top=20,left=20,screenX=20,  screenY=20,scrollbars=no,resizable=yes';
var openIt = window.open(image,'ImageWindow',args)
}

function thumbGrid () {
var i,j,k;
var numPics=39;
document.write("<table width='640' border='1' cellspacing='0' cellpadding='5' align='center'>");
for (i=1;i<=numPics;i+=3) {
document.write("<tr>");
for (j=0;j<3;j++) {
k=i+j;
if (k < 10) {
document.write("<td><a href=javascript:createWindow('photos/photo0" + k + ".jpg')><img src='thumbs/thumb0" + k + ".jpg' border='0'></a></td>");
}
else {
document.write("<td><a href=javascript:createWindow('photos/photo" + k + ".jpg')><img src='thumbs/thumb" + k + ".jpg' border='0'></a></td>");
}
}
document.write("</tr>");
}
document.write("</table>");
}
</script>
</head>
<body>
<h1 align="center">My Photos</h1>
<p align="center">Click on image to see larger version</p>
<script language="javascript">thumbGrid();</script>
</body>
</html>

Previous [1] [2] [3] [4] [5] Next
Home