101
10-13-2002, 09:03 AM
I need a picture viewer for my site but have been finding it really hard to make.
I wish to include a picture on the left of the screen (preferably 450 by 450 on a 1024/768 resolution)
Then on the right side
Then 4 buttons which say first (This take you to the first picture) , last (This takes you to the last picture) , next (This takes you to the next picture)
and previous (This takes you to the previous picture).
Also there would be a textbox on the side and it changes with every picture and says things like who it was by and a comment.
And under nearth that a drop down box which lists all the images and you can click them and then that image would be shown.
Here are 3 scripts which include all the material but need to be interwinded:
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>
<BR>
<img src="1.jpg" width="450" height="450" border="1" name="base" alt="Picture Viewer.">
<form name="Myform">
<Script Language="JavaScript">
image1 = new Image();
image1.src = "1.jpg";
image2 = new Image();
image2.src = "2.jpg";
image3 = new Image();
image3.src = "3.jpg";
red= new Array();
red[0]="Text1";
red[1]="Text2.";
red[2]="Text3.";
dom = (document.getElementById)? true:false
ns4 = (document.layers)? true:false
ie4 = (document.all && !dom)? true:false
if (ns4) document.write('<DIV style="LEFT: 650px; TOP: 20px; POSITION: absolute;"><textarea name="dropdownchanger" wrap="soft" rows="5" cols="20">' +red[0] + '</textarea><br></DIV>')
else document.write('<div id="dropdownchanger" style="width:200px; height:50px;"><p>' +red[0] + '</p></div>')
function change(){
document.base.src=eval(document.Myform.Myselect.options[document.Myform.Myselect.options.selectedIndex].value);
if (ns4) {document.Myform.dropdownchanger.value=red[document.Myform.Myselect.options.selectedIndex]}
if (ie4) {document.all['dropdownchanger'].innerHTML ='<p>' + red[document.Myform.Myselect.options.selectedIndex] + '</p>'}
else if (dom) {document.getElementById("dropdownchanger").innerHTML ='<p>' + red[document.Myform.Myselect.options.selectedIndex] + '</p>'}
}
</Script>
<DIV style="LEFT: 650px; TOP: 20px; POSITION: absolute;">
<h1><u>Picture Viewer</u></h1>
<BR>
<BR>
<select name="Myselect" onChange="change()" size="1">
<option value="image1.src" selected>Picture1</option>
<option value="image2.src">Picture 2</option>
<option value="image3.src">Picture 3</option>
</select>
</DIV>
</form>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>
<CENTER>
<Script Language="JavaScript">
var timer_id = 0;
var image_array = new Array (4);
var time_array = new Array (4);
image_array[0] = new Image();
image_array[0].src = 'Welcome.bmp';
time_array[0] = 4000;
image_array[1] = new Image();
image_array[1].src = '1.gif';
time_array[1] = 4000;
image_array[2] = new Image();
image_array[2].src = 'image3.jpg';
time_array[2] = 4000;
image_array[3] = new Image();
image_array[3].src = 'image4.jpg';
time_array[3] = 4000;
var current = 0;
var is_playing = 0;
function next () {
current = current + 1;
if ( current == 4 )
current = 0;
document.images.slideshow.src = image_array[current].src;
}
function previous () {
current = current - 1;
if ( current == -1 )
current = 3
document.images.slideshow.src = image_array[current].src;
}
function rewind () {
current = 0;
document.images.slideshow.src = image_array[current].src;
}
function forward () {
current = 3;
document.images.slideshow.src = image_array[current].src;
}
</Script>
<br>
<table border=1 width="100%"cellspacing=1 cellpadding=4 >
<tr>
<td align=center>
<b>Picture Viewer</b>
</td>
</tr>
<tr><td align="center" >
<img src="Welcome.bmp" name="slideshow" width="400" height="275">
</td></tr>
<tr><form>
<td align=center>
<table border=1>
<tr>
<td align="center"><input type=button onclick="rewind();" value="First" title="Go to first image" "button style=width:80px;height=25px;"></td>
<td align="center"><input type=button onclick="previous();" value="Previous" title="Show previous image" "button style=width:80px;height=25px;"></td>
<td align="center"><input type=button onclick="next();" value="Next" title="Show next image" "button style=width:80px;height=25px;"></td>
<td align="center"><input type=button onclick="forward();" value="Last" title="Go to last image" "button style=width:80px;height=25px;"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</CENTER>
</BODY>
</HTML>
<html>
<head>
<title>
</title>
</head>
<Script Language="JavaScript">
var thisImg = 0
var imgCt = 11
var name = "Picture Viewer.bmp"
var caption="Welcome To The Picture Viewer!"
function newSlide(direction){
if (document.images){
thisImg = thisImg + direction
if (thisImg < 0){ thisImg = 0}
if (thisImg == imgCt) {thisImg=0}
if (thisImg == 0) {
name = "Picture Viewer.bmp"
caption = "Welcome To The Picture Viewer!"
document.imgForm.imgtext.value = caption
}
if (thisImg == 1) {
name = "Consolenator.jpg"
caption = "... By ..."
document.imgForm.imgtext.value = caption
}
if (thisImg == 2) {
name = "X-box II.jpg"
caption = "... By ..."
document.imgForm.imgtext.value = caption
}
if (thisImg == 3) {
name = "X-Box mini.jpg"
caption = "... By ...."
document.imgForm.imgtext.value = caption
}
if (thisImg == 4) {
name = "Doom III.jpg"
caption = "... By ...."
document.imgForm.imgtext.value = caption
}
if (thisImg == 5) {
name = "... By ..."
caption = "Star Wars by Chirisu - Episode 2 saw I recently."
document.imgForm.imgtext.value = caption
}
if (thisImg == 6) {
name = "EEjapan.gif"
caption = "... By ...."
document.imgForm.imgtext.value = caption
}
if (thisImg == 7) {
name = "original.jpg"
caption = "... By ...t."
document.imgForm.imgtext.value = caption
}
if (thisImg == 8) {
name = "Pro Sk473r.jpg"
caption = "... By ...."
document.imgForm.imgtext.value = caption
}
if (thisImg == 9) {
name = "EEWN.jpg"
caption = "... By ..."
document.imgForm.imgtext.value = caption
}
if (thisImg == 10) {
name = "underestimate.jpg"
caption = "... By ..."
document.imgForm.imgtext.value = caption
}
document.slideshow.src = "anime/" + name
}
}
</script>
<body>
<img height="450" width="450" src="Picture Viewer.bmp" ALT="Welcome To The Picture Viewer"" NAME="slideshow" ALIGN="left" HSPACE="10">
<input type="button" value="<<" name="go" onclick="newSlide(-1)">
<input type="button" value=">>" name="go" onclick="newSlide(1)">
<input type="button" value="Picture of the day" name="go" onclick="best()">
<form name="imgForm">
<textarea name="imgtext" rows="9" cols="20" READONLY></textarea>
</form>
</body>
</html>
I wish to include a picture on the left of the screen (preferably 450 by 450 on a 1024/768 resolution)
Then on the right side
Then 4 buttons which say first (This take you to the first picture) , last (This takes you to the last picture) , next (This takes you to the next picture)
and previous (This takes you to the previous picture).
Also there would be a textbox on the side and it changes with every picture and says things like who it was by and a comment.
And under nearth that a drop down box which lists all the images and you can click them and then that image would be shown.
Here are 3 scripts which include all the material but need to be interwinded:
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>
<BR>
<img src="1.jpg" width="450" height="450" border="1" name="base" alt="Picture Viewer.">
<form name="Myform">
<Script Language="JavaScript">
image1 = new Image();
image1.src = "1.jpg";
image2 = new Image();
image2.src = "2.jpg";
image3 = new Image();
image3.src = "3.jpg";
red= new Array();
red[0]="Text1";
red[1]="Text2.";
red[2]="Text3.";
dom = (document.getElementById)? true:false
ns4 = (document.layers)? true:false
ie4 = (document.all && !dom)? true:false
if (ns4) document.write('<DIV style="LEFT: 650px; TOP: 20px; POSITION: absolute;"><textarea name="dropdownchanger" wrap="soft" rows="5" cols="20">' +red[0] + '</textarea><br></DIV>')
else document.write('<div id="dropdownchanger" style="width:200px; height:50px;"><p>' +red[0] + '</p></div>')
function change(){
document.base.src=eval(document.Myform.Myselect.options[document.Myform.Myselect.options.selectedIndex].value);
if (ns4) {document.Myform.dropdownchanger.value=red[document.Myform.Myselect.options.selectedIndex]}
if (ie4) {document.all['dropdownchanger'].innerHTML ='<p>' + red[document.Myform.Myselect.options.selectedIndex] + '</p>'}
else if (dom) {document.getElementById("dropdownchanger").innerHTML ='<p>' + red[document.Myform.Myselect.options.selectedIndex] + '</p>'}
}
</Script>
<DIV style="LEFT: 650px; TOP: 20px; POSITION: absolute;">
<h1><u>Picture Viewer</u></h1>
<BR>
<BR>
<select name="Myselect" onChange="change()" size="1">
<option value="image1.src" selected>Picture1</option>
<option value="image2.src">Picture 2</option>
<option value="image3.src">Picture 3</option>
</select>
</DIV>
</form>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>
<CENTER>
<Script Language="JavaScript">
var timer_id = 0;
var image_array = new Array (4);
var time_array = new Array (4);
image_array[0] = new Image();
image_array[0].src = 'Welcome.bmp';
time_array[0] = 4000;
image_array[1] = new Image();
image_array[1].src = '1.gif';
time_array[1] = 4000;
image_array[2] = new Image();
image_array[2].src = 'image3.jpg';
time_array[2] = 4000;
image_array[3] = new Image();
image_array[3].src = 'image4.jpg';
time_array[3] = 4000;
var current = 0;
var is_playing = 0;
function next () {
current = current + 1;
if ( current == 4 )
current = 0;
document.images.slideshow.src = image_array[current].src;
}
function previous () {
current = current - 1;
if ( current == -1 )
current = 3
document.images.slideshow.src = image_array[current].src;
}
function rewind () {
current = 0;
document.images.slideshow.src = image_array[current].src;
}
function forward () {
current = 3;
document.images.slideshow.src = image_array[current].src;
}
</Script>
<br>
<table border=1 width="100%"cellspacing=1 cellpadding=4 >
<tr>
<td align=center>
<b>Picture Viewer</b>
</td>
</tr>
<tr><td align="center" >
<img src="Welcome.bmp" name="slideshow" width="400" height="275">
</td></tr>
<tr><form>
<td align=center>
<table border=1>
<tr>
<td align="center"><input type=button onclick="rewind();" value="First" title="Go to first image" "button style=width:80px;height=25px;"></td>
<td align="center"><input type=button onclick="previous();" value="Previous" title="Show previous image" "button style=width:80px;height=25px;"></td>
<td align="center"><input type=button onclick="next();" value="Next" title="Show next image" "button style=width:80px;height=25px;"></td>
<td align="center"><input type=button onclick="forward();" value="Last" title="Go to last image" "button style=width:80px;height=25px;"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</CENTER>
</BODY>
</HTML>
<html>
<head>
<title>
</title>
</head>
<Script Language="JavaScript">
var thisImg = 0
var imgCt = 11
var name = "Picture Viewer.bmp"
var caption="Welcome To The Picture Viewer!"
function newSlide(direction){
if (document.images){
thisImg = thisImg + direction
if (thisImg < 0){ thisImg = 0}
if (thisImg == imgCt) {thisImg=0}
if (thisImg == 0) {
name = "Picture Viewer.bmp"
caption = "Welcome To The Picture Viewer!"
document.imgForm.imgtext.value = caption
}
if (thisImg == 1) {
name = "Consolenator.jpg"
caption = "... By ..."
document.imgForm.imgtext.value = caption
}
if (thisImg == 2) {
name = "X-box II.jpg"
caption = "... By ..."
document.imgForm.imgtext.value = caption
}
if (thisImg == 3) {
name = "X-Box mini.jpg"
caption = "... By ...."
document.imgForm.imgtext.value = caption
}
if (thisImg == 4) {
name = "Doom III.jpg"
caption = "... By ...."
document.imgForm.imgtext.value = caption
}
if (thisImg == 5) {
name = "... By ..."
caption = "Star Wars by Chirisu - Episode 2 saw I recently."
document.imgForm.imgtext.value = caption
}
if (thisImg == 6) {
name = "EEjapan.gif"
caption = "... By ...."
document.imgForm.imgtext.value = caption
}
if (thisImg == 7) {
name = "original.jpg"
caption = "... By ...t."
document.imgForm.imgtext.value = caption
}
if (thisImg == 8) {
name = "Pro Sk473r.jpg"
caption = "... By ...."
document.imgForm.imgtext.value = caption
}
if (thisImg == 9) {
name = "EEWN.jpg"
caption = "... By ..."
document.imgForm.imgtext.value = caption
}
if (thisImg == 10) {
name = "underestimate.jpg"
caption = "... By ..."
document.imgForm.imgtext.value = caption
}
document.slideshow.src = "anime/" + name
}
}
</script>
<body>
<img height="450" width="450" src="Picture Viewer.bmp" ALT="Welcome To The Picture Viewer"" NAME="slideshow" ALIGN="left" HSPACE="10">
<input type="button" value="<<" name="go" onclick="newSlide(-1)">
<input type="button" value=">>" name="go" onclick="newSlide(1)">
<input type="button" value="Picture of the day" name="go" onclick="best()">
<form name="imgForm">
<textarea name="imgtext" rows="9" cols="20" READONLY></textarea>
</form>
</body>
</html>