Click to See Complete Forum and Search --> : Modify Pop Up Window


Tel
04-21-2003, 11:43 AM
I have a pop up window with an image and a close button, is it possible to have on either side of the close button, a button for << and >> to go to the next image instead of closing the window and selecting the next one.

Thanks in advance.

This is the window code:

<SCRIPT language="JavaScript">

function display_image(form) {
selectionname = form.imagename.options[form.imagename.selectedIndex].text;
selection = form.imagename.options[form.imagename.selectedIndex].value;
PreView = window.open("", "Preview", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars,resizable,copyhistory=0,width=200,h eight=255");
PreView.document.open();
PreView.document.write("<HTML><HEAD>");
PreView.document.write("<TITLE>Screen Capture</TITLE>");
PreView.document.write("</HEAD><BODY BGCOLOR=000000 TEXT=FFFFFF>");
PreView.document.write("<FORM><CENTER><B><FONT SIZE=+1>" +
selectionname + "</FONT></B><HR>");
PreView.document.write("<IMG HSPACE=0 VSPACE=0 " +
"SRC='" + selection + "'>");
PreView.document.write("<HR><FORM><INPUT TYPE='button' VALUE='Close' " +
"onClick='window.close()'></FORM>");
PreView.document.write("</CENTER>");
PreView.document.write("</BODY></HTML>");
PreView.document.close();
}
</SCRIPT>


<FORM>
<select NAME="imagename" onChange="display_image(this.form)">
<option value="http://worlddvdlinks.co.uk/images/xxx1.jpg" SELECTED>Image 1
<option value="http://worlddvdlinks.co.uk/images/xxx2.jpg">Image 2
<option value="http://worlddvdlinks.co.uk/images/xxx3.jpg">Image 3
<option value="http://worlddvdlinks.co.uk/images/xxx4.jpg">Image 4
</select>
</FORM>

khalidali63
04-21-2003, 12:08 PM
What you need to do is in the next or previous buttons on click events call a function that should appropriately display the next image or previous one..You can adapt some slide show functionalities,
You want to look at this site for code examples..

http://www.dynamicdrive.com

Tel
04-22-2003, 02:30 PM
Thanks for the reply. To tell you the truth I don't know what I'm doing, but I'll have a look and give it a go.

Cheers!