www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > JavaScript

    JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...)

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 08-24-2006, 01:26 PM
    crisgrnr crisgrnr is offline
    Registered User
     
    Join Date: Aug 2006
    Posts: 3
    Unhappy help with slideshow for photogallery

    I am building a photogallery for the website that I am working on, but I can't seem to get the javascript for the slideshow to work. I want the veiwer to be able to click a "next" or "previous" and view the photos...I have about 107 photos for this album alone. I have been staring at this code for about 3 days and I just can't find the problem... when I pull it up in the browser and click on "next" or "previous" I get an "error on page" message on the status bar then it says "javascript:doNext()" Please help...here is my code:

    <html lang="en">
    <head>
    <title></title>
    </head>
    <body><BODY TEXT="#000000" LINK="red" VLINK="blue" BGCOLOR="#616D7E"><FONT FACE="Pristina" size="4.5" COLOR="#800517"><MARQUEE bgcolor="#616D7E" font color="#800517" font face= loop="-1" scrollamount="8"
    width="100%"><b>This is one of many controlled burns conducted as part of our fire and rescue training.</b></MARQUEE></FONT>
    <HR COLOR="#1569C7">

    <p align="center"><img name="myPicture" src="E:\Delhifire.com\Website Coding\DFD-burn-2005-001.jpg">

    <script language="JavaScript">
    <!--
    //Slide Show script (this notice must stay intact)
    //For this and more scripts
    //visit java-scripts.net or http://wsabstract.com

    var myPix = new Array("DFD-burn-2005-001.jpg","DFD-burn-2005-002.jpg","DFD-burn-2005-004.jpg",
    "DFD-burn-2005-005.jpg","DFD-burn-2005-021.jpg","DFD-burn-2005-022.jpg","DFD-burn-2005-028.jpg","DFD-burn-2005-044.jpg",
    "DFD-burn-2005-045.jpg","DFD-burn-2005-046.jpg","DFD-burn-2005-049.jpg","DFD-burn-2005-053.jpg","DFD-burn-2005-056.jpg",
    "DFD-burn-2005-058.jpg","DFD-burn-2005-059.jpg","DFD-burn-2005-061.jpg","DFD-burn-2005-063.jpg","DFD-burn-2005-064.jpg",
    "DFD-burn-2005-065.jpg","DFD-burn-2005-066.jpg","DFD-burn-2005-067.jpg","DFD-burn-2005-069.jpg","DFD-burn-2005-070.jpg",
    "DFD-burn-2005-071.jpg","DFD-burn-2005-072.jpg","DFD-burn-2005-073.jpg","DFD-burn-2005-074.jpg","DFD-burn-2005-075.jpg",
    "DFD-burn-2005-076.jpg","DFD-burn-2005-077.jpg","DFD-burn-2005-078.jpg","DFD-burn-2005-082.jpg","DFD-burn-2005-083.jpg",
    "DFD-burn-2005-084.jpg","DFD-burn-2005-087.jpg","DFD-burn-2005-089.jpg","DFD-burn-2005-091.jpg","DFD-burn-2005-093.jpg",
    "DFD-burn-2005-094.jpg","DFD-burn-2005-097.jpg","DFD-burn-2005-099.jpg","DFD-burn-2005-100.jpg","DFD-burn-2005-105.jpg",
    "DFD-burn-2005-109.jpg","DFD-burn-2005-111.jpg","DFD-burn-2005-113.jpg","DFD-burn-2005-115.jpg","DFD-burn-2005-116.jpg",
    "DFD-burn-2005-117.jpg","DFD-burn-2005-120.jpg","DFD-burn-2005-121.jpg","DFD-burn-2005-122.jpg","DFD-burn-2005-124.jpg",
    "DFD-burn-2005-127.jpg","DFD-burn-2005-129.jpg","DFD-burn-2005-130.jpg","DFD-burn-2005-132.jpg","DFD-burn-2005-134.jpg",
    "DFD-burn-2005-135.jpg","DFD-burn-2005-137.jpg","DFD-burn-2005-139.jpg","DFD-burn-2005-146.jpg","DFD-burn-2005-149.jpg",
    "DFD-burn-2005-151.jpg","DFD-burn-2005-152.jpg","DFD-burn-2005-153.jpg","DFD-burn-2005-154.jpg","DFD-burn-2005-156.jpg",
    "DFD-burn-2005-157.jpg","DFD-burn-2005-159.jpg","DFD-burn-2005-160.jpg","DFD-burn-2005-170.jpg","DFD-burn-2005-171.jpg",
    "DFD-burn-2005-174.jpg","DFD-burn-2005-183.jpg","DFD-burn-2005-184.jpg","DFD-burn-2005-186.jpg","DFD-burn-2005-188.jpg",
    "DFD-burn-2005-190.jpg","DFD-burn-2005-192.jpg","DFD-burn-2005-193.jpg","DFD-burn-2005-196.jpg","DFD-burn-2005-197.jpg",
    "DFD-burn-2005-199.jpg","DFD-burn-2005-201.jpg","DFD-burn-2005-202.jpg","DFD-burn-2005-203.jpg","DFD-burn-2005-205.jpg",
    "DFD-burn-2005-223.jpg","DFD-burn-2005-231.jpg","DFD-burn-2005-236b.jpg","DSC03053.jpg","DSC03054.jpg",
    "DSC03073.jpg","File0001.jpg","File0002.jpg","File0006.jpg","File0008.jpg",
    "File0011.jpg","File0013.jpg","File0017.jpg","File0019.jpg","File0023.jpg",
    "File0024.jpg","File0027.jpg","File0028.jpg","File0034.jpg")var thisPic = 0

    function doPrevious() {
    if (document.images && thisPic > 0) {
    thisPic--
    document.myPicture.src=myPix[thisPic]
    }
    }

    function doNext() {
    if (document.images && thisPic < 108) {
    thisPic++
    document.myPicture.src=myPix[thisPic]
    }
    }
    // -->
    </script>

    <br><small><font face="Verdana"><a href="javascript:doPrevious()">Previous</a><font color="#FFFFFF">-</font>
    <a href="javascript:doNext()">Next</a></font></small>

    </body>
    </html>
    Reply With Quote
      #2  
    Old 08-24-2006, 02:27 PM
    gil davis's Avatar
    gil davis gil davis is offline
    Nobody important
     
    Join Date: Nov 2002
    Posts: 4,456
    Not sure if this is the problem, but it might be:
    Code:
    if (document.images && thisPic > 0) {
    ...
    if (document.images && thisPic < 108) {
    Try
    Code:
    if (document.images && (thisPic > 0)) {
    ...
    if (document.images && (thisPic < 108)) {
    Reply With Quote
      #3  
    Old 08-24-2006, 03:33 PM
    crisgrnr crisgrnr is offline
    Registered User
     
    Join Date: Aug 2006
    Posts: 3
    nope...I tried that just now..it still gives me the error on page message..
    Reply With Quote
      #4  
    Old 08-25-2006, 05:06 AM
    gil davis's Avatar
    gil davis gil davis is offline
    Nobody important
     
    Join Date: Nov 2002
    Posts: 4,456
    Is this really the way your code is?
    Quote:
    ...
    "File0024.jpg","File0027.jpg","File0028.jpg","File0034.jpg")var thisPic = 0
    Perhaps some semicolons would help:
    Code:
    ...
    "File0024.jpg","File0027.jpg","File0028.jpg","File0034.jpg");
    var thisPic = 0;
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 04:05 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.