Results 1 to 4 of 4

Thread: Slideshow

  1. #1
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Slideshow

    1) Script Title: Ultimate Fade-in slideshow (v1.51)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem:
    Happy Holidays to all of you!

    This is my first time posting. I'm working on a web project and trying to get this done before the first of the year. The limitation is that I'm using an out of the box program. So, I have two choices: Its either I wait several weeks to months for the developers of the "out of the box" program by submitting an addition request (which I have done two weeks ago) or... I get this JS code figured out. The latter method is probably the best bet in terms of time constraints that I am currently facing.

    This it the first time I've really dug into JS. My JS knowledge is very limited and I could write very simple JS, that is about it. I have a form that I'm building that outputs data in between < script > .... </ script >. The data output begins at number 1 of the array. It is shown below

    Output Code: ( javascript )

    Code:
    <!-- BEGIN OUTPUT FROM MY SITE ***
    <script type="text/javascript">
    var fadeimages=new Array()
    fadeimages[1]=["../Portals/3/PropertiesImages/thm_host_20071209_035346.jpg", "http://www.google.com", ""]
    fadeimages[2]=["../Portals/3/PropertiesImages/thm_host_20071209_091810.jpg", "http://www.google.com", ""]
    fadeimages[3]=["../Portals/3/PropertiesImages/thm_host_20071209_094217.jpg", "http://www.google.com", ""]
    fadeimages[4]=["../Portals/3/PropertiesImages/thm_host_20071209_094947.jpg", "http://www.google.com", ""]
    fadeimages[5]=["../Portals/3/PropertiesImages/thm_host_20071209_095901.jpg", "http://www.google.com", ""]
    fadeimages[6]=["../Portals/3/PropertiesImages/thm_host_20071209_100204.jpg", "http://www.google.com", ""]
    fadeimages[7]=["../Portals/3/PropertiesImages/thm_host_20071209_111622.jpg", "http://www.google.com", ""]
    var fadebgcolor="white"
    </script>
    <script type="text/javascript">
    //new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)
    new fadeshow(fadeimages, 140, 225, 0, 3000, 1, "R")
    </script>
    *** END OUTPUT FROM MY SITE-->
    I copied the JS from this site: http://www.dynamicdrive.com/dynamic...inslideshow.htm

    I tried changing this piece of the code:
    Code: ( javascript )

    Code:
    for (p=1;p<theimages.length;p++){
    this.postimages[p]=new Image()
    this.postimages[p].src=theimages[p][0]
    }
    Originally, p=0. It did not work when I changed to p=1. I also attempted to change other variables in an attempt to get it to start the array at 1 as opposed to 0.

    How can I get the javascript code to work when I'm faced with an array that begins at fadeimages[1] as opposed to beginning at fadeimages[0]? What variable(s) do I need to change in order to make this work with the array beginning at fadeimages[1]?

    Thank you,

    -E

  2. #2
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Try something like:

    Code:
    this.postimages[p+1]=new Image()
    this.postimages[p+1].src=theimages[p+1][0]
    Just a guess.

    Is there a reason why it starts at 1 (such as the 0 array is being used for something else)? If not, it would be easier to conform to the script's way of setting up the array.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  3. #3
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Jas View Post
    Try something like:

    Code:
    this.postimages[p+1]=new Image()
    this.postimages[p+1].src=theimages[p+1][0]
    Just a guess.

    Is there a reason why it starts at 1 (such as the 0 array is being used for something else)? If not, it would be easier to conform to the script's way of setting up the array.
    I appreciate taking the time and I did that change seen above and it did not work =(

    I realize that it would be a whole lot easier to conform to the scripts' way of setting up the array. I am not trained as a programmer, so I bought an out of the box module for dotnetnuke. The module outputs starting at 1, not 0. I'm faced with a time constraint to get this site up and running, and I have submitted a ticket to add this feature to the developers of the module. It may take them weeks, if not months to implement this feature. That leaves me with a limitation of options.

    If you know of another script that you can change the array to 1 easily, I would be all ears. I've searched and searched for this solution.

    -E

  4. #4
    Join Date
    Dec 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Hey,

    You just gave me a brilliant idea. I just figured it out!

    What I did was change this (original):

    Code:
    for (p=0;p<theimages.length;p++){
    this.postimages[p]=new Image()
    this.postimages[p].src=theimages[p][0]
    to this to make it work:

    Code:
    for (p=0;p+1<theimages.length;p++){
    this.postimages[p]=new Image()
    this.postimages[p].src=theimages[p][0]
    Don't know if this will be of any value to anyone, but I thought I'd pass this on just in case.

    Happy Holidays!

    -E

Bookmarks

Posting Permissions

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