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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    May 2004
    Location
    Canada
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Can anyone help with JavaScript Coding

    HI There,

    I have been struggling with JavaScript code for days now, and this is my last resort! Please help...send replies or futher information to ksorman@shaw.ca

    I am trying to create a JavaScript slide show with links for Next Slide, Previous Slide and Home Slide.

    Is it possible for you to view my page and tell me what I am doing wrong. I have looked at this page for hours and can't figure it out, I must be missing something or have something in the wrong order, but can't figure it out...please help....thanks...

    I think I need someone to explain the EXACT code for this page as it would appear in the page so it displays correctly.

    If you can figure this out, I have 2 more I need help with too...

    Thanks so much, Much appreciated...but this is a URGENT request. Need a quick answer that will work!

    Any ideas????

    Here is my code:
    <HTML>
    <HEAD>
    <TITLE>JavaScript Slide Show - PhotoAlbum</TITLE>

    <SCRIPT LANGUAGE="JavaScript">

    var PhotoAlbum = new
    Array("bunny_lady.gif","business_lady.gif","running_lady.gif","color_lady.gif")
    var PicIndex=1
    var pictures=PhotoAlbum.length

    function NextImage ( ) {
    if (PicIndex < pictures) {
    PicIndex++
    }
    document.ImgAlbum.src=PhotoAlbum[PicIndex-1]
    }

    function PreviousImage ( ) {
    if (PicIndex > 1) {
    PicIndex--
    }
    document.ImgAlbum.src=PhotoAlbum[PicIndex-1]
    }

    function home ( ) {
    document.ImgAlbum.src=PhotoAlbum[0]
    }


    </SCRIPT>
    </HEAD>

    <BODY BACKGROUND=BACK02.jpg TEXT=Blue>

    <CENTER>

    <H1 ALIGN=Center> The Vacation Photo Album</H1><BR>
    <H3 ALIGN=Center> Click on Previous or Next to view pictures in my Slide Show </H3><HR><HR>

    <IMG SRC=bunny_purse.gif NAME= ImgAlbum Width=400 Height=270>
    <BR>
    <HR>
    <A HREF="JavaScript:home ( ) ">[First Image]</A>
    <A HREF="JavaScript:PreviousImage ( )">[Previous Image]</A>
    <A HREF="JavaScript:NextImage ( )">[Next Image]</A>
    </CENTER>

    </BODY>
    </HTML>
    Last edited by TrvlOrm; 05-05-2004 at 06:46 AM. Reason: Change title

  • #2
    New to the CF scene
    Join Date
    May 2004
    Location
    Canada
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Can anyone help me???

    Is there anyone out there who can help me with this please??????

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When you ask this:

    Please help...send replies or futher information to ksorman@shaw.ca
    I automaticallly assume you have no intention of returning to the forum. So any response here would be useless. I also don't provide "personal" help, I reply to forum messages for people who are willing to work on the problem in the public forum, that way others who have similar problems can search for the problem and perhaps find the answers they need much more quickly than the typical "ask a question then get a reply" cycle allows.

    A quick check of your page appears to work, are you sure you've got the right names and locations for your images (your initial image certainly doesn't match any of the other images)?
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #4
    New to the CF scene
    Join Date
    May 2004
    Location
    Canada
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Help needed still please.....

    Yes, I am open to discussion forums - I am new at this, so posting here is fine for replies. Thanks for letting me know.

    I am sure all my images correspond, and can't get the next or previous image button to work.

    Any other help much appreciated....

    I do return quite often....


    Quote Originally Posted by Roy Sinclair
    When you ask this:



    I automaticallly assume you have no intention of returning to the forum. So any response here would be useless. I also don't provide "personal" help, I reply to forum messages for people who are willing to work on the problem in the public forum, that way others who have similar problems can search for the problem and perhaps find the answers they need much more quickly than the typical "ask a question then get a reply" cycle allows.

    A quick check of your page appears to work, are you sure you've got the right names and locations for your images (your initial image certainly doesn't match any of the other images)?

  • #5
    New to the CF scene
    Join Date
    May 2004
    Location
    Canada
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow adding .gif images to slideshow

    Ok, Images correspond.. But is there any way to add 2 or 3 more .gif images to the next button?



    <HTML>
    <HEAD>
    <TITLE>JavaScript Slide Show - PhotoAlbum</TITLE>

    <SCRIPT LANGUAGE="JavaScript">

    var PhotoAlbum = new
    Array("bunny_purse.gif","business_lady.gif","running_lady.gif","color_lady.gif")
    var PicIndex=1
    var pictures=PhotoAlbum.length

    function NextImage ( ) {
    if (PicIndex < pictures) {
    PicIndex++
    }
    document.ImgAlbum.src=PhotoAlbum[PicIndex-1]
    }

    function PreviousImage ( ) {
    if (PicIndex > 1) {
    PicIndex--
    }
    document.ImgAlbum.src=PhotoAlbum[PicIndex-1]
    }

    function home ( ) {
    document.ImgAlbum.src=PhotoAlbum[0]
    }


    </SCRIPT>
    </HEAD>

    <BODY BACKGROUND=BACK02.jpg TEXT=Blue>

    <CENTER>

    <H1 ALIGN=Center> The Vacation Photo Album</H1><BR>
    <H3 ALIGN=Center> Click on Previous or Next to view pictures in my Slide Show </H3><HR><HR>

    <IMG SRC=bunny_purse.gif NAME= ImgAlbum Width=400 Height=270>
    <BR>
    <HR>
    <A HREF="JavaScript:home ( ) ">[First Image]</A>
    <A HREF="JavaScript:PreviousImage ( )">[Previous Image]</A>
    <A HREF="JavaScript:NextImage ( )">[Next Image]</A>
    </CENTER>

    </BODY>
    </HTML>

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can add new pictures by adding them to the array you define here:

    Code:
     var PhotoAlbum = new Array("bunny_purse.gif","business_lady.gif","running_lady.gif","color_lady.gif","anewimage.gif")
    I copied your page and renamed some gifs and the whole thing worked work me as is, you are placing those images in the same directory as the page aren't you?
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #7
    New to the CF scene
    Join Date
    May 2004
    Location
    Canada
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thank You

    Thank you So much, I got it to finally work...Boy that took a while, still don't know what I did wrong, but when I copied your code - it worked. That's all I needed it to do.,...thanks again.


  •  

    Posting Permissions

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