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 3 of 3

Thread: slide show

  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation slide show

    Can someone please look at this and tell me what i am doing wrong and how to fix it? thank you.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>
    <head>
    <title>Slideshow</title>
    <script type="text/javascript" language="JAVASCRIPT">
    <!--
    var vacationSlides = new Array();
    vacationSlides[1] = new Image();
    vacationSlides[2] = new Image();
    vacationSlides[3] = new Image();
    vacationSlides[4] = new Image();
    vacationSlides[5] = new Image();

    vacationSlides[1].src = "images\hawaii.gif";
    vacationSlides[2].src = "images\blue.jpg";
    vacationSlides[3].src = "images\wave.gif";
    vacationSlides[4].src = "images\waterfall.bmp";
    vacationSlides[5].src = "images\is.jpg";

    var varCaptions = new Array();
    varCaptions[1] = " ";
    varCaptions[2] = " ";
    varCaptions[3] = " ";
    varCaptions[4] = " ";
    varCaptions[5] = " ";

    var varSlide = 1;
    var varTotal = vacationSlides.length - 1;

    function fcnSlides(direction){
    if (direction == "next"){
    (varSlide == varTotal) ? varSlide = 1 : varSlide++;
    }else{
    (varSlide == 1) ? varSlide = varTotal : varSlide--;
    }//end else
    if (document.images){
    document.imgFrame.src = vacationSlides[varSlide].src;
    document.frmControls.txtCaption.value = varCaptions[varSlide];
    document.frmControls.txtSlide.value = varSlide;
    }//end if
    }//end function
    var ID = "";
    function Views(){
    var set;
    set = setInterval('0',1000);
    document.startclock.seconds.value = set;
    }//end function
    function start(){
    ID = setInterval('Time()',1000);
    }//end function start
    function stop(){
    clearInterval(ID);
    }//end function stop

    function Time(){
    var varat = new Date();
    var varhour = varat.getHours();
    var varminute = varat.getMinutes();
    var varsecond = varat.getSeconds();

    var varvalue = varhour > 12 ? varhour - 12 : varhour;
    varvalue == 0 ? varvalue = 12 : varvalue;
    varvalue += varminute < 10 ? ":0" : ":";
    varvalue += varminute;
    varvalue += varsecond < 10 ? ":0" : ":";
    varvalue += varsecond;
    varvalue += varhour >= 12? " PM" : " AM";
    document.startclock.time.value = varvalue;
    }//end function
    //-->
    </script>
    </head>

    <body bgcolor="white" onload="Views();" onload="Time();">
    <script language="JAVASCRIPT" type="text/javascript" src="dynamicgreeting.js">
    <!--
    document.write(vargreeting);
    //-->
    </script>

    <div align="LEFT">
    <h2>Photos of Your Future Vacation</h2>

    <img src="images\pearlharbor.jpg" name="imgFrame" width="320" height="240">

    <form name="frmControls">
    <p><textarea name="txtCaption" rows="2" cols="50">
    </textarea><br>
    <br>
    <input type="button" value="Previous Slide" onclick="fcnSlides('previous');">
    <input type="button" value="Next Slide" onclick="fcnSlides('next');"><br>
    <br>
    <input type="text" value="1" name="txtSlide" size="1"></p>
    </form>
    <form name="startclock">
    <input name="time" size="10">
    <input type="button" name="start" value="Start" onclick="start();">
    <input type="button" name="stop" value="Stop" onclick="stop();"><p></p>
    <input name="seconds" size="10"></form>
    </div>
    </body>
    </html>

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,511
    Thanks
    3
    Thanked 504 Times in 491 Posts
    change start() to StartIt()
    && change stop() to StopIt()

    stop & start are reserved

    and best to use onclick="javascript:StartIt();"

    Is that it??

    or somthing else surpost to happen

  • #3
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    goto www.woodenmantles.com

    they have a nice slide show there just copy the source code


  •  

    Posting Permissions

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