24 users online (1 members and 23 guests)  

Thread: Slide Show Help


  Results 1 to 2 of 2

Related

  1. CSS Menu does not show in IE    Forum: CSS Forum
    Replies: 1
  2. Show it off    Forum: General Discussion
    Replies: 3
  3. Dynamic FX Slide Menu Not Working    Forum: HTML Forum
    Replies: 2
  4. Show it off!    Forum: Show it off!
    Replies: 5
  1. #1
    raidersize's Avatar
    New User

    Status
    Offline
    Join Date
    May 2007
    Posts
    1

    Slide Show Help

    I am a novice at this and i am trying to get a manual slideshow to work. I have it working on one page but I need to have other slide shows on other pages. How do I switch the image source so it doesn't keep pulling for the same image source as the other page??

    Here is the code: For the head

    Code:
    <script language="JavaScript">
    /* Extension written by David G. Miles 
    based in part on code written by Thomas Brattli
    // Courtesy of SimplytheBest.net - 
    if(document.images) { 
            currentslide=1; 
            maxslides=6; 
            slide = new Array(maxslides+1); 
            for(var n=1;n<=maxslides;n++) { 
                slide[n]=new Image(500,245); 
                slide[n].src='images/'+n+'.gif'; 
            } 
        } 
        function prevSlide() { 
            if(document.images) { 
                currentslide--; 
                if(currentslide<1) currentslide=maxslides; 
                document.images['slide'].src=slide[currentslide].src; 
            } 
        } 
        function nextSlide() { 
            if(document.images) { 
                currentslide++; 
                if(currentslide>maxslides) currentslide=1; 
                document.images['slide'].src=slide[currentslide].src; 
            } 
        } 
    </script>

    Here is the code: For the body

    Code:
    <!-- Start SlideShow -->
    <table border=0 cellspacing=0 cellpadding=0>
    <tr> 
    <td height=5 colspan=2> </td>
    </tr>
    <tr valign=bottom align=center> 
    <td height=245 colspan=2><img name='slide' width=500 height=245 border=0 hspace=0 vspace=0 alt='slideshow' src='images/1.gif'></td>
    </tr>
    <tr> 
    <td height=5 colspan=2> </td>
    </tr>
    <tr> 
    <td height=5 align=left><a href='javascript:prevSlide()'><img src="images/button_previous.gif" width="20" height="20" alt="Previous" border="0"></a></td>
    <td height=5 align=right><a href='javascript:nextSlide()'><img src="images/button_next.gif" width="20" height="20" alt="Next" border="0"></a></td>
    </tr>
    </table>
    <!-- End SlideShow -->
    Last edited by vinyl-junkie; 05-26-2007 at 02:34 PM. Reason: Added code tags

  2. #2
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Slide Show Help

    The following section of code sets up the array of images for the slide show. Just change this section to reflect the names of different slides for another slide show.

    Code:
            maxslides=6; 
            slide = new Array(maxslides+1); 
            for(var n=1;n<=maxslides;n++) { 
                slide[n]=new Image(500,245); 
                slide[n].src='images/'+n+'.gif'; 
            }
    In order to have maximum reusability of your code, you could make this section a separate javascript. Also, use external scripts instead of embedding them in the page they're used in.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more



Tags for this Thread