Results 1 to 5 of 5

Thread: Slideshow Script Troubles

  1. #1
    Join Date
    Nov 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Slideshow Script Troubles

    I can't figure out what is going wrong with this script. The error on the Explorer page says it's an unterminated string constant. I've gone throught the code several times and tried recopying. Here's the code as it stands now:

    <script language="JavaScript1.2">

    /***********************************************
    * Flexi Slideshow- © Dynamic Drive (www.dynamicdrive.com)
    * This notice must stay intact for use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    var variableslide=new Array()

    //variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]

    variableslide[0]=['http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=584', '', '<a href="http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=545">Interview with Dr. Stephen Meyer - leader in the I.D. movement (Long clip - 42.5 mb)</a>
    <br><a href="http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=499">Same as above but just in Audio (3.29 mb)</a>']

    variableslide[1]=['http://www.reviewevolution.net/graphics/openFlagellum.jpg', '', '<i><small>A prime example of Michael Behe's "irreducible complexity" is the bacteria flagellum. With over 40 essential parts, the flagellum is a rotary motor used to propel a bacteria in liquid. Spinning at 17,000 rpms, the motor is acid driven, liquid cooled, self-replicating, and self-repairing. If one part is removed, it can not function</small></i>
    <br>
    If it could be demonstrated that any complex organ existed which could not possibly have been formed by numerous, successive, slight modifications, my theory would absolutely break down.<br>
    ~ Charles Darwin, Origin of Species

    <br><a href="http://www.sedin.org/mol_museum.html">Click Here for a theistic blog</a>
    <br><a href="http://www.evolutionnews.org/2005/09/title_43.html">Click Here for a atheistic blog</a>
    <br><a href="http://www.talkdesign.org/faqs/flagellum.html">Or here</a>']

    variableslide[2]=['http://www.getreligion.org/archives/DNA.jpg', '', '<i>DNA is a more advanced code than what we have for computer programming. In order to have a computer program, you must have a Programmer. Does this mean that it in order to have DNA Code, there must be a Code Writer?</i><br>
    <a href="http://www.allaboutscience.org/dna-double-helix.htm">DNA Info Site</a><br>
    <a href="http://www.eweek.com/article2/0,1759,1645675,00.asp">People are even using DNA code to replace computer coding. See this article.</a>']

    variableslide[3]=['http://www.pinkdome.com/archives/ethics.gif', '', '<center><i>Good or Bad Explanation for Morals? Where do all 3 come from?</i><br></center>']

    //configure the below 3 variables to set the dimension/background color of the slideshow

    var slidewidth='325px' //set to width of LARGEST image in your slideshow
    var slideheight='500px' //set to height of LARGEST image in your slideshow, plus any text description
    var slidebgcolor='#0E0E0E'

    //configure the below variable to determine the delay between image rotations (in miliseconds)
    var slidedelay=4000

    ////Do not edit pass this line////////////////

    var ie=document.all
    var dom=document.getElementById

    for (i=0;i<variableslide.length;i++){
    var cacheimage=new Image()
    cacheimage.src=variableslide[i][0]
    }

    var currentslide=0

    function rotateimages(){
    contentcontainer='<center>'
    if (variableslide[currentslide][1]!="")
    contentcontainer+='<a href="'+variableslide[currentslide][1]+'">'
    contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="3">'
    if (variableslide[currentslide][1]!="")
    contentcontainer+='</a>'
    contentcontainer+='</center>'
    if (variableslide[currentslide][2]!="")
    contentcontainer+=variableslide[currentslide][2]

    if (document.layers){
    crossrotateobj.document.write(contentcontainer)
    crossrotateobj.document.close()
    }
    else if (ie||dom)
    crossrotateobj.innerHTML=contentcontainer
    if (currentslide==variableslide.length-1) currentslide=0
    else currentslide++
    setTimeout("rotateimages()",slidedelay)
    }

    if (ie||dom)
    document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')

    function start_slider(){
    crossrotateobj=dom? document.getElementById("slidedom") : ie? document.all.slidedom : document.slidensmain.document.slidenssub
    if (document.layers)
    document.slidensmain.visibility="show"
    rotateimages()
    }

    if (ie||dom)
    start_slider()
    else if (document.layers)
    window.onload=start_slider

    </script>

    <ilayer id="slidensmain" width=&{slidewidth}; height=&{slideheight}; bgColor=&{slidebgcolor}; visibility=hide><layer id="slidenssub" width=&{slidewidth}; left=0 top=0></layer></ilayer>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It is impossible for me to tell what errors may be in that code. After you paste in your code you need to highlight it all and then hit the # symbol in the editor to enclose it in code tags. That way the normal line wrap of the editor will be suspended and a textarea created to contain your code. Better still is to:

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format for asking a question.
    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry, here's the links:
    http://www.dynamicdrive.com/dynamici...flexislide.htm
    http://moriasophy.blogspot.com

    And here's the script again:
    -----------------------------------------------------------------------

    Code:
     
    <script language="JavaScript1.2">
    
    /***********************************************
    * Flexi Slideshow- © Dynamic Drive (www.dynamicdrive.com)
    * This notice must stay intact for use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    var variableslide=new Array()
    
    //variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]
    
    variableslide[0]=['http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=584', '', '<a href="http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=545">Interview with Dr. Stephen Meyer - leader in the I.D. movement (Long clip - 42.5 mb)</a>
             <br><a href="http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=499">Same as above but just in Audio (3.29 mb)</a>']
    
    variableslide[1]=['http://www.reviewevolution.net/graphics/openFlagellum.jpg', '', '<i><small>A prime example of Michael Behe's "irreducible complexity" is the bacteria flagellum. With over 40 essential parts, the flagellum is a rotary motor used to propel a bacteria in liquid. Spinning at 17,000 rpms, the motor is acid driven, liquid cooled, self-replicating, and self-repairing.  If one part is removed, it can not function</small></i>
    <br>
    If it could be demonstrated that any complex organ existed which could not possibly have been formed by numerous, successive, slight modifications, my theory would absolutely break down.<br>
    ~ Charles Darwin, Origin of Species
    
    <br><a href="http://www.sedin.org/mol_museum.html">Click Here for a theistic blog</a>
    <br><a href="http://www.evolutionnews.org/2005/09/title_43.html">Click Here for a atheistic blog</a>
    <br><a href="http://www.talkdesign.org/faqs/flagellum.html">Or here</a>']
    
    variableslide[2]=['http://www.getreligion.org/archives/DNA.jpg', '', '<i>DNA is a more advanced code than what we have for computer programming.  In order to have a computer program, you must have a Programmer. Does this mean that it in order to have DNA Code, there must be a Code Writer?</i><br>
    <a href="http://www.allaboutscience.org/dna-double-helix.htm">DNA Info Site</a><br>
    <a href="http://www.eweek.com/article2/0,1759,1645675,00.asp">People are even using DNA code to replace computer coding. See this article.</a>']
    
    variableslide[3]=['http://www.pinkdome.com/archives/ethics.gif', '', '<center><i>Good or Bad Explanation for Morals?  Where do all 3 come from?</i><br></center>']
    
    //configure the below 3 variables to set the dimension/background color of the slideshow
    
    var slidewidth='325px' //set to width of LARGEST image in your slideshow
    var slideheight='500px' //set to height of LARGEST image in your slideshow, plus any text description
    var slidebgcolor='#0E0E0E'
    
    //configure the below variable to determine the delay between image rotations (in miliseconds)
    var slidedelay=4000
    
    ////Do not edit pass this line////////////////
    
    var ie=document.all
    var dom=document.getElementById
    
    for (i=0;i<variableslide.length;i++){
    var cacheimage=new Image()
    cacheimage.src=variableslide[i][0]
    }
    
    var currentslide=0
    
    function rotateimages(){
    contentcontainer='<center>'
    if (variableslide[currentslide][1]!="")
    contentcontainer+='<a href="'+variableslide[currentslide][1]+'">'
    contentcontainer+='<img src="'+variableslide[currentslide][0]+'" border="0" vspace="3">'
    if (variableslide[currentslide][1]!="")
    contentcontainer+='</a>'
    contentcontainer+='</center>'
    if (variableslide[currentslide][2]!="")
    contentcontainer+=variableslide[currentslide][2]
    
    if (document.layers){
    crossrotateobj.document.write(contentcontainer)
    crossrotateobj.document.close()
    }
    else if (ie||dom)
    crossrotateobj.innerHTML=contentcontainer
    if (currentslide==variableslide.length-1) currentslide=0
    else currentslide++
    setTimeout("rotateimages()",slidedelay)
    }
    
    if (ie||dom)
    document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')
    
    function start_slider(){
    crossrotateobj=dom? document.getElementById("slidedom") : ie? document.all.slidedom : document.slidensmain.document.slidenssub
    if (document.layers)
    document.slidensmain.visibility="show"
    rotateimages()
    }
    
    if (ie||dom)
    start_slider()
    else if (document.layers)
    window.onload=start_slider
    
    </script>
    
    <ilayer id="slidensmain" width=&{slidewidth}; height=&{slideheight}; bgColor=&{slidebgcolor}; visibility=hide><layer id="slidenssub" width=&{slidewidth}; left=0 top=0></layer></ilayer>
    I know I'm missing something and that it's just right under my nose but I can't find it! I'm going to feel stupid once this is over.

    Please help,
    Dredzs
    Last edited by Dredzs; 11-13-2005 at 04:20 PM.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Ah, that's much better, thanks. The various entries characterized as:

    Code:
    variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]
    Must be all on one line or use conventions that make them appear that way to the script parser. Since the easiest way is simply to use 'all on one line', just replace:

    Code:
    variableslide[0]=['http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=584', '', '<a href="http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=545">Interview with Dr. Stephen Meyer - leader in the I.D. movement (Long clip - 42.5 mb)</a>
             <br><a href="http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=499">Same as above but just in Audio (3.29 mb)</a>']
    
    variableslide[1]=['http://www.reviewevolution.net/graphics/openFlagellum.jpg', '', '<i><small>A prime example of "irreducible complexity" is the bacteria flagellum. With over 40 essential parts, the flagellum is a rotary motor used to propel a bacteria in liquid. Spinning at 17,000 rpms, the motor is acid driven, liquid cooled, self-replicating, and self-repairing.  If one part is removed, it can not function</small></i>
    <br>
    If it could be demonstrated that any complex organ existed which could not possibly have been formed by numerous, successive, slight modifications, my theory would absolutely break down.<br>
    - Charles Darwin, Origin of Species
    
    <br><a href="http://www.sedin.org/mol_museum.html">Click Here for a theistic blog</a>
    <br><a href="http://www.evolutionnews.org/2005/09/title_43.html">Click Here for an atheistic blog</a>
    <br><a href="http://www.talkdesign.org/faqs/flagellum.html">Or here</a>']
    
    variableslide[2]=['http://www.getreligion.org/archives/DNA.jpg', '', '<i>DNA is a more advanced code than what we have for computer programming.  In order to have a computer program, you must have a Programmer. Does this mean that it in order to have DNA Code, there must be a Code Writer?</i><br>
    <a href="http://www.allaboutscience.org/dna-double-helix.htm">DNA Info Site</a><br>
    <a href="http://www.eweek.com/article2/0,1759,1645675,00.asp">Scientists are even using DNA code to replace computer coding. See this article.</a>']
    
    variableslide[3]=['http://www.pinkdome.com/archives/ethics.gif', '', '<center><i>Good or Bad Explanation for Morals?  Where do all 3 come from?</i><br></center>']
    with:

    Code:
    variableslide[0]=['http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=584', '', '<a href="http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=545">Interview with Dr. Stephen Meyer - leader in the I.D. movement (Long clip - 42.5 mb)</a> <br><a href="http://www.discovery.org/scripts/viewDB/filesDB-download.php?command=download&id=499">Same as above but just in Audio (3.29 mb)</a>']
    
    variableslide[1]=['http://www.reviewevolution.net/graphics/openFlagellum.jpg', '', '<i><small>A prime example of "irreducible complexity" is the bacteria flagellum. With over 40 essential parts, the flagellum is a rotary motor used to propel a bacteria in liquid. Spinning at 17,000 rpms, the motor is acid driven, liquid cooled, self-replicating, and self-repairing.  If one part is removed, it can not function</small></i><br>If it could be demonstrated that any complex organ existed which could not possibly have been formed by numerous, successive, slight modifications, my theory would absolutely break down.<br>- Charles Darwin, Origin of Species<br><a href="http://www.sedin.org/mol_museum.html">Click Here for a theistic blog</a><br><a href="http://www.evolutionnews.org/2005/09/title_43.html">Click Here for an atheistic blog</a><br><a href="http://www.talkdesign.org/faqs/flagellum.html">Or here</a>']
    
    variableslide[2]=['http://www.getreligion.org/archives/DNA.jpg', '', '<i>DNA is a more advanced code than what we have for computer programming.  In order to have a computer program, you must have a Programmer. Does this mean that it in order to have DNA Code, there must be a Code Writer?</i><br><a href="http://www.allaboutscience.org/dna-double-helix.htm">DNA Info Site</a><br><a href="http://www.eweek.com/article2/0,1759,1645675,00.asp">Scientists are even using DNA code to replace computer coding. See this article.</a>']
    
    variableslide[3]=['http://www.pinkdome.com/archives/ethics.gif', '', '<center><i>Good or Bad Explanation for Morals?  Where do all 3 come from?</i><br></center>']
    Works here in a local demo.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Nov 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Thanks! I really appreciate it.

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
  •