McKirahan said:
[snip]
Another approach would be to disable "invalid" buttons.
Okay, here's a version with this feature too.
It works in IE and FF but not NS; see
http://www.quirksmode.org/js/cssdisable.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Bow's and foggy's stored signatures</title>
<script type="text/javascript">
var pics = new
Array("finished1.jpg","foghorn.jpg","motto.jpg","sig.jpg","SWAT.jpg","title.
gif");
var pict = Math.round(Math.random()*(pics.length-1));
for (var i=0; i<pics.length; i++) {
var img = new Image();
img.src = pics
;
}
function view(what) {
if (what == "<<") {
pict = 0;
} else if (what == "<") {
if (pict > 0) pict--;
} else if (what == ">") {
if (pict < pics.length-1) pict++;
} else if (what == ">>") {
pict = pics.length-1;
}
document.images["sigsviewer"].src = pics[pict];
window.status = "Picture " + (pict+1) + " of " + pics.length;
//
document.getElementById("F").disabled = false;
document.getElementById("P").disabled = false;
document.getElementById("N").disabled = false;
document.getElementById("L").disabled = false;
if (pict == 0) {
document.getElementById("F").disabled = true;
document.getElementById("P").disabled = true;
} else if (pict == pics.length-1) {
document.getElementById("N").disabled = true;
document.getElementById("L").disabled = true;
}
}
</script>
</head>
<body onload="view('')"
background="http://home.insightbb.com/clipart/backgrounds/bkgnd019.gif">
<base href="http://home.insightbb.com/~bow.foggy/sigs/">
<h1 align="center">Bow's and foggy's stored grahics</h1>
<h2 align="center" style="color:red">Team Special Forces</h2>
<center>
<h1>sigs</h1>
<form>
<input type="button" value="First" id="F" style="width:100px"
onclick="view('<<')">
<input type="button" value="Previous" id="P" style="width:100px"
onclick="view('<')">
<input type="button" value="Next" id="N" style="width:100px"
onclick="view('>')">
<input type="button" value="Last" id="L" style="width:100px"
onclick="view('>>')">
</form>
<table border="0">
<tr height="200">
<th><img id="sigsviewer" src="" style="border: solid 1px black"></th>
</tr>
</table>
<p>If you have a smilely</p>
<p align="center">Then email it to us at<a
href="mailto:[email protected]">[email protected]</a></p>
</body>
</html>