Click to See Complete Forum and Search --> : Javascript image gallery help
why_not_mac
11-07-2003, 01:34 PM
I need help with a script I modified and cannot reach the original creator, though many failed attempts.
If you go to this URL...
http://nt1.adventuresports.com/service/authenticoutdoors/AOIportfolio.asp?SubCat=Adventure#
I have previous and next links that work great from the ORIGINAL big image on the page, but I NEED to get the sequence of photos to pick up from the image that shows up when you click on one of the thumbnails on the right side of the page.
Currently, when i click a thumbnail, the previous and next links start from the beginning photo, this is not what I want!
I cannot seem to add an appropriate variable to make this work.
Please help, and IT MUST WORK IN ALL BROWSERS! Thanks.
Post the code you have, it should be adaptable
why_not_mac
11-11-2003, 01:50 PM
THIS IS THE HEAD SECTION......
<!-- Original: Daniel Smith (xalres@earthlink.net) -->
<!-- Web Site: http://home.earthlink.net/~xalres -->
<!-- MODIFIED by Norm Schurdell http://www.whynotdesign.com -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
prev1 = new Image (32,18);
prev1.src = "prev1.jpg";
prev2 = new Image (32,18);
prev2.src = "prev2.jpg";
next1 = new Image (32,18);
next1.src = "next1.jpg";
next2 = new Image (32,18);
next2.src = "next2.jpg";
go1 = new Image (48,24);
go1.src = "go1.jpg";
go2 = new Image (48,24);
go2.src = "go2.jpg";
maxPic = 12;
p1 = new Image (350,350);
p1.src = "images/adkclimb156_2.jpg";
link1 = "images/adkclimb156_2.jpg";
p2 = new Image (350,350);
p2.src = "images/adkclimb27_2.jpg";
link2 = "images/adkclimb27_2.jpg";
p3 = new Image (350,350);
p3.src = "images/brushbrook29_2.jpg";
link3 = "images/brushbrook29_2.jpg";
p4 = new Image (350,350);
p4.src = "images/chicchocski213_2.jpg";
link4 = "images/chicchocski213_2.jpg";
p5 = new Image (350,350);
p5.src = "images/climberw-leaves_2.jpg";
link5 = "images/climberw-leaves_2.jpg";
p6 = new Image (350,350);
p6.src = "images/kayaklakechamplain153_2.jpg";
link6 = "images/kayaklakechamplain153_2.jpg";
p7 = new Image (350,350);
p7.src = "images/lostskiareas66_2.jpg";
link7 = "images/lostskiareas66_2.jpg";
p8 = new Image (350,350);
p8.src = "images/nepal1846_2.jpg";
link8 = "images/nepal1846_2.jpg";
p9 = new Image (350,350);
p9.src = "images/p99h82_2.jpg";
link9 = "images/p99h82_2.jpg";
p10 = new Image (350,350);
p10.src = "images/rumney50_2.jpg";
link10 = "images/rumney50_2.jpg";
p11 = new Image (350,350);
p11.src = "images/sleepyhollow6_2.jpg";
link11 = "images/sleepyhollow6_2.jpg";
p12 = new Image (350,350);
p12.src = "images/tet18_2.jpg";
link12 = "images/tet18_2.jpg";
count = 1;
function next() {
count++;
if (count > maxPic) {
count = 1;
}
eval("document.p.src=p" + count + ".src");
}
function prev() {
count--;
if (count == 0) {
count = maxPic;
}
eval("document.p.src=p" + count + ".src");
}
function link() {
location.href=eval("link" + count);
}
// End -->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
THESE ARE THE PREV and NEXT LINKS......
<P><IMG SRC="images/spacer.gif" WIDTH="100" HEIGHT="1" BORDER="0"></P>
<P> <A HREF="javascript:prev()" NAME="prev">
<FONT SIZE="2" COLOR="#FFFFFF" FACE="Arial, Helvetica">< Previous</FONT></A></P>
<P> <A HREF="javascript:next()" NAME="next">
<FONT SIZE="2" COLOR="#FFFFFF" FACE="Arial, Helvetica"> Next ></FONT></A></P>
THIS IS A SAMPLE OF THE GALLERY SECTION......
<TD VALIGN="MIDDLE" ALIGN="CENTER"><A HREF="#" ONCLICK="p.src=p1.src">
<IMG SRC="images/adkclimb156_1.jpg" WIDTH="60" HEIGHT="60" BORDER="0" NAME="thumb"></A>
</TD>
<TD VALIGN="MIDDLE" ALIGN="CENTER"><A HREF="#" ONCLICK="p.src=p2.src">
<IMG SRC="images/adkclimb27_1.jpg" WIDTH="60" HEIGHT="60" BORDER="0" NAME="thumb"></A>
</TD>
<TD VALIGN="MIDDLE" ALIGN="CENTER"><A HREF="#" ONCLICK="p.src=p3.src">
<IMG SRC="images/brushbrook29_1.jpg" WIDTH="60" HEIGHT="60" BORDER="0" NAME="thumb"></A>
</TD>
</TR><TR>
<TD VALIGN="MIDDLE" ALIGN="CENTER"><A HREF="#" ONCLICK="p.src=p4.src">
<IMG SRC="images/chicchocski213_1.jpg" WIDTH="60" HEIGHT="60" BORDER="0" NAME="thumb"></A>
</TD>
THANKS! THANKS! THANKS!
Please take a look in the zip.
Let me know how it goes
why_not_mac
11-12-2003, 11:35 AM
THANK YOU SOOO MUCH Mr J - you are the supreme webmaster in my book!
:) :) :)
why_not_mac
11-12-2003, 01:46 PM
One more question for ya Mr J, or anyone. The script you sent works great! And for that I am thankful, but please also look at the following page and around line 82 is the original ASP code, I cannot get the javascript Array to be populated as an ASP variable by accessing a data store.
For this script (it images) will change and be unique with each page it calls.
Thanks again.
Hi why_not_mac
Unfortunately I cannot help you with ASP or PHP problems as I have not yet delved into the wonders that they can do.
Sometime in the near future I hope to start learning about these codes, but for now I am sorry that I cannot help you further
:(
why_not_mac
11-15-2003, 01:11 PM
Thank you anyway for all of your help, best wishes for your future code endeavors.