 |
06-10-2003, 11:34 AM
|
#1 (permalink)
| | Registered User
Join Date: Nov 2002 Location: Boise, Idaho
Posts: 2,361
| » 
Java script IMG gallery help.
Ok I have this page Im working on that is an image gallery. I found a script on the net that does what I want it to do so I started modifying it so that it works with my image based page. http://www.clanimo.com/clans/cs/csgall/
Now what I have is a page that looks like that but has a text box that displays a desception under it. That I can remove fine but I use to make sure the script is working. The problem is the next and previous buttons that are under it, when I remove them the next img based button quits woking. (The pluss sign) But if I restore the buttons at the bottom of the page it works again. Why is it that the next quits and the previous doesnt? Code: <html>
<head>
<title>index.jpg</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- Fireworks MX Dreamweaver MX target. Created Tue Jun 10 10:03:51 GMT-0700 (Pacific Daylight Time) 2003-->
<script language="JavaScript">
<!--
<!-- Hide from old browsers
// Copyright © 1999 Doug Popeney
// Created by Doug Popeney (easyjava@easyjavascipt.com)
// JavaScript Made Easy!! - http://www.easyjavascript.com
var i = 1
images = new Array
images[1] = "01.gif"
images[2] = "02.gif"
images[3] = "03.gif"
images[4] = "1.jpg"
images[5] = "2.jpg"
images[6] = "3.jpg"
description = new Array
description[1] = "This is the first image of six"
description[2] = "DESCRIPTION2"
description[3] = "DESCRIPTION3"
description[4] = "DESCRIPTION4"
description[5] = "DESCRIPTION5"
description[6] = "DESCRIPTION6"
function gallery(){
if (i == 1){
document.gallery.desc.value = description[1]
document.gallery.previous.value=" "}
}
function previmg(){
if (i != 1) {
i --
document.img.src = images[i];
document.gallery.desc.value = description[i];
document.gallery.next.value = "Next"}
if (i == 1) {
document.gallery.previous.value=" "}
}
function nextimg(){
if (i != 6) {
i ++
document.gallery.previous.value="Previous"
image = images[i]
document.img.src = image
document.gallery.desc.value = description[i];}
if (i ==6){
document.gallery.next.value=" ";}
}
function pickrand(){
var imagenumber = 6 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1;
var randimage = images[rand1]
document.img.src = randimage
document.gallery.desc.value = description[rand1];
i = rand1
if (i == 1){
document.gallery.previous.value=" ";}
else {
document.gallery.previous.value="Previous";}
if (i == 6){
document.gallery.next.value=" ";}
else {
document.gallery.next.value="Next";}
}
function firstimg(){
i = 1
document.img.src = images[i];
document.gallery.desc.value = description[i];
document.gallery.previous.value=" ";
document.gallery.next.value="Next"
}
function lastimg(){
i = 6
document.img.src = images[i];
document.gallery.desc.value = description[i];
document.gallery.next.value=" "
document.gallery.previous.value="Previous"
}
// -- End Hiding Here -->
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body bgcolor="#000000" onLoad="MM_preloadImages('index_r2_c2_f2.jpg','index_r4_c2_f2.jpg','index_r6_c6_f2.jpg','index_r8_c2_f2.jpg','index_r10_c6_f2.jpg','index_r12_c2_f2.jpg','index_r14_c2_f2.jpg','index_r14_c6_f2.jpg','index_r16_c2_f2.jpg','index_r18_c6_f2.jpg','index_r20_c2_f2.jpg','index_r23_c2_f2.jpg');" onLoad="var SymTmpWinOpen = window.open; window.open = SymWinOpen; gallery();; window.open = SymTmpWinOpen;">
<body bgcolor="#000000" onLoad="MM_preloadImages('index_r2_c2_f2.jpg','index_r4_c2_f2.jpg','index_r6_c6_f2.jpg','index_r8_c2_f2.jpg','index_r10_c6_f2.jpg','index_r12_c2_f2.jpg','index_r14_c2_f2.jpg','index_r14_c6_f2.jpg','index_r16_c2_f2.jpg','index_r18_c6_f2.jpg','index_r20_c2_f2.jpg','index_r23_c2_f2.jpg')">
<center>
<form name="gallery">
<table border="0" cellpadding="0" cellspacing="0" width="482">
<!-- fwtable fwsrc="img_gall2.png" fwbase="index.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<td><img src="spacer.gif" width="5" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="146" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="38" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="243" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="22" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="21" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="7" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td colspan="7"><img name="index_r1_c1" src="index_r1_c1.jpg" width="482" height="69" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="69" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="24"><img name="index_r2_c1" src="index_r2_c1.jpg" width="5" height="258" border="0" alt=""></td>
<td><a href="gal1.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r2_c2','','index_r2_c2_f2.jpg',1);"><img name="index_r2_c2" src="index_r2_c2.jpg" width="146" height="28" border="0" alt=""></a></td>
<td rowspan="3" colspan="5"><img name="index_r2_c3" src="index_r2_c3.jpg" width="331" height="35" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="28" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r3_c2" src="index_r3_c2.jpg" width="146" height="2" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="2" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="3"><a href="gal2.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r4_c2','','index_r4_c2_f2.jpg',1);"><img name="index_r4_c2" src="index_r4_c2.jpg" width="146" height="28" border="0" alt=""></a></td>
<td><img src="spacer.gif" width="1" height="5" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="21"><img name="index_r5_c3" src="index_r5_c3.jpg" width="38" height="223" border="0" alt=""></td>
<td rowspan="19"><img name="img" src="01.gif" width="243" height="202" border="0" alt=""></td>
<td colspan="3"><img name="index_r5_c5" src="index_r5_c5.jpg" width="50" height="1" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="20"><img name="index_r6_c5" src="index_r6_c5.jpg" width="22" height="222" border="0" alt=""></td>
<td rowspan="3"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r6_c6','','index_r6_c6_f2.jpg',1);" onClick="previmg();"><img name="index_r6_c6" src="index_r6_c6.jpg" width="21" height="40" border="0" alt=""></a></td>
<td rowspan="20"><img name="index_r6_c7" src="index_r6_c7.jpg" width="7" height="222" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="22" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r7_c2" src="index_r7_c2.jpg" width="146" height="2" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="2" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="3"><a href="gall3.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r8_c2','','index_r8_c2_f2.jpg',1);"><img name="index_r8_c2" src="index_r8_c2.jpg" width="146" height="28" border="0" alt=""></a></td>
<td><img src="spacer.gif" width="1" height="16" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r9_c6" src="index_r9_c6.jpg" width="21" height="2" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="2" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="3"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r10_c6','','index_r10_c6_f2.jpg',1);"><img name="index_r10_c6" src="index_r10_c6.jpg" width="21" height="40" border="0" alt=""></a></td>
<td><img src="spacer.gif" width="1" height="10" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r11_c2" src="index_r11_c2.jpg" width="146" height="2" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="2" border="0" alt=""></td>
</tr>
<tr>
<td><a href="gall4.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r12_c2','','index_r12_c2_f2.jpg',1);"><img name="index_r12_c2" src="index_r12_c2.jpg" width="146" height="28" border="0" alt=""></a></td>
<td><img src="spacer.gif" width="1" height="28" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r13_c2" src="index_r13_c2.jpg" width="146" height="2" border="0" alt=""></td>
<td><img name="index_r13_c6" src="index_r13_c6.jpg" width="21" height="2" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="2" border="0" alt=""></td>
</tr>
<tr>
<td><a href="gall5.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r14_c2','','index_r14_c2_f2.jpg',1);"><img name="index_r14_c2" src="index_r14_c2.jpg" width="146" height="28" border="0" alt=""></a></td>
<td rowspan="3"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r14_c6','','index_r14_c6_f2.jpg',1);"><img name="index_r14_c6" src="index_r14_c6.jpg" width="21" height="40" border="0" alt=""></a></td>
<td><img src="spacer.gif" width="1" height="28" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r15_c2" src="index_r15_c2.jpg" width="146" height="2" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="2" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="3"><a href="gall6.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r16_c2','','index_r16_c2_f2.jpg',1);"><img name="index_r16_c2" src="index_r16_c2.jpg" width="146" height="28" border="0" alt=""></a></td>
<td><img src="spacer.gif" width="1" height="10" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r17_c6" src="index_r17_c6.jpg" width="21" height="2" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="2" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="3"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r18_c6','','index_r18_c6_f2.jpg',1);" onClick="nextimg();"><img name="index_r18_c6" src="index_r18_c6.jpg" width="21" height="40" border="0" alt="" ></a></td>
<td><img src="spacer.gif" width="1" height="16" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r19_c2" src="index_r19_c2.jpg" width="146" height="2" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="2" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2"><a href="gall7.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r20_c2','','index_r20_c2_f2.jpg',1);"><img name="index_r20_c2" src="index_r20_c2.jpg" width="146" height="28" border="0" alt=""></a></td>
<td><img src="spacer.gif" width="1" height="22" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="5"><img name="index_r21_c6" src="index_r21_c6.jpg" width="21" height="56" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="6" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r22_c2" src="index_r22_c2.jpg" width="146" height="2" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="2" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2"><a href="gall8.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('index_r23_c2','','index_r23_c2_f2.jpg',1);"><img name="index_r23_c2" src="index_r23_c2.jpg" width="146" height="28" border="0" alt=""></a></td>
<td><img src="spacer.gif" width="1" height="27" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2"><img name="index_r24_c4" src="index_r24_c4.jpg" width="243" height="21" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r25_c2" src="index_r25_c2.jpg" width="146" height="20" border="0" alt=""></td>
<td><img src="spacer.gif" width="1" height="20" border="0" alt=""></td>
</tr>
</table>
<input type=text value=" " name="desc" size=40>
<br>
<input type=button value="Previous" name="previous" onClick="previmg();">
<input type=button value="Next" name="next" onClick="nextimg();">
</form>
</center>
</BODY>
<script language="JavaScript">
<!--
window.open = SymRealWinOpen;
//-->
</script>
</body>
</html>
PyroSama
__________________
[imgbox=#000000]http://clanimo.com/themes/bluebyu/images/logo.gif[/imgbox][url=http://www.clanimo.com]ClanIMO.com[/url]
|
| |
06-10-2003, 01:20 PM
|
#2 (permalink)
| | Registered User
Join Date: Nov 2002 Location: Boise, Idaho
Posts: 2,361
|
^^
__________________
[imgbox=#000000]http://clanimo.com/themes/bluebyu/images/logo.gif[/imgbox][url=http://www.clanimo.com]ClanIMO.com[/url]
|
| |
06-11-2003, 09:40 PM
|
#3 (permalink)
| | Registered User
Join Date: Nov 2002 Location: Boise, Idaho
Posts: 2,361
|
^^
__________________
[imgbox=#000000]http://clanimo.com/themes/bluebyu/images/logo.gif[/imgbox][url=http://www.clanimo.com]ClanIMO.com[/url]
|
| |
06-13-2003, 03:56 PM
|
#4 (permalink)
| | Registered User
Join Date: Oct 2001 Location: Indiana, USA
Posts: 1,685
|
can't offer any help but here is a ^bump^ for ya...
---edwelly
__________________
If you never try anything new,
you will miss out of some of life's many disappointments...
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions  | | | | | Recent Discussions  | | | | | |