Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Banned
    Join Date
    Oct 2010
    Posts
    115
    Thanks
    30
    Thanked 0 Times in 0 Posts

    Help with slideshow please!

    This slideshow has a drop down menu that lets you go from one picture to another.

    Can someone help me modify it so that instead of a dropdown menu i have a list of numbers (horizontally,not vertically)?

    I know absolutley nothing about javascript. sorry.

    Thanks programmers!

    <!-- configurable script -->
    <script type="text/javascript">
    theimage = new Array();

    theimage[0]=["url", "", "1"];
    theimage[1]=["url", "", "2"];
    theimage[2]=["url", "", "3"];

    //###########################################
    window.onload=function(){

    //preload images into browser
    preloadSlide();

    //"jump to" box
    for (y=0;y<theimage.length;y++) {
    document.slideshow.imgComboBox[y]=new Option(theimage[y][2]);
    }

    //set the first slide
    SetSlide(0);

    }

    //###########################################
    function SetSlide(num) {
    //too big
    i=num%theimage.length;
    //too small
    if(i<0)i=theimage.length-1;

    //switch the image
    document.images.imgslide.src=theimage[i][0];

    //if drop down box
    if(document.slideshow.imgComboBox){
    document.slideshow.imgComboBox.selectedIndex = i;
    }

    //if they want name of current slide
    document.getElementById('slidebox').innerHTML=theimage[i][2];

    }


    //###########################################
    function PlaySlide() {
    if (!window.playing) {
    PlayingSlide(i+1);
    if(document.slideshow.play){
    document.slideshow.play.value=" Stop ";
    }
    }
    else {
    playing=clearTimeout(playing);
    if(document.slideshow.play){
    document.slideshow.play.value=" Play ";
    }
    }
    // if you have to change the image for the "playing" slide
    if(document.images.imgPlay){
    setTimeout('document.images.imgPlay.src="'+imgStop+'"',1);
    imgStop=document.images.imgPlay.src
    }
    }


    //###########################################
    function PlayingSlide(num) {
    playing=setTimeout('PlayingSlide(i+1);SetSlide(i+1);', playspeed);
    }


    //###########################################
    function preloadSlide() {
    for(k=0;k<theimage.length;k++) {
    theimage[k][0]=new Image().src=theimage[k][0];
    }
    }


    </script>


    <!-- slide show HTML -->
    <form name="slideshow">

    <table border="1" cellpadding="2" cellspacing="0">
    <tr>
    <td align="center">
    <a href="#" onmouseover="this.href=theimage[i][1];return false">
    <script type="text/javascript">
    document.write('<img name="imgslide" id="imgslide" src="'+theimage[0][0]+'" border="0">')
    </script>
    </a>
    </td>
    </tr>
    <tr>
    <td align="center"><div id="slidebox"></div></td>
    </tr>
    <tr>
    <td align="center">
    <select name="imgComboBox" onchange="SetSlide(document.slideshow.imgComboBox.selectedIndex);"></select>
    </td>
    </tr>
    </table>

    </form>
    <!-- end of slide show HTML -->

  • #2
    Banned
    Join Date
    Oct 2010
    Posts
    115
    Thanks
    30
    Thanked 0 Times in 0 Posts
    Also im new to this forum.

    Could someone let me know how to subscribe to threads?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •