Results 1 to 5 of 5

Thread: Addition to current script

  1. #1
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Addition to current script

    1) Script Title: Expanding current script

    2) Script URL (on DD):

    3) Describe problem: I have this current script for a photo slideshow, I was wondering if I could make the slideshow start again (reset) instead of just ending. Thanks!
    Code:
    /***********************************************
    * DHTML slideshow script-  � Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice must stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    var photos=new Array()
    var photoslink=new Array()
    var which=0
    
    //define images. You can have as many as you want:
    photos[0]=["./images/slide01.png"]
    photos[1]=["./images/slide02.png"]
    photos[2]=["./images/slide03.png"]
    photos[3]=["./images/slide04.png"]
    photos[4]=["./images/slide05.png"]
    photos[5]=["./images/slide06.png"]
    photos[6]=["./images/slide07.png"]
    photos[7]=["./images/slide08.png"]
    photos[8]=["./images/slide09.png"]
    photos[9]=["./images/slide10.png"]
    
    //Specify whether images should be linked or not (1=linked)
    var linkornot=0
    
    //Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
    
    //do NOT edit pass this line
    
    var preloadedimages=new Array()
    for (i=0;i<photos.length;i++){
    preloadedimages[i]=new Image()
    preloadedimages[i].src=photos[i]
    }
    
    
    function applyeffect(){
    if (document.all && photoslider.filters){
    photoslider.filters.revealTrans.Transition=6
    photoslider.filters.revealTrans.stop()
    photoslider.filters.revealTrans.apply()
    }
    }
    
    
    
    function playeffect(){
    if (document.all && photoslider.filters)
    photoslider.filters.revealTrans.play()
    }
    
    function keeptrack(){
    window.status="Image "+(which+1)+" of "+photos.length
    }
    
    
    function backward(){
    if (which>0){
    which--
    applyeffect()
    document.images.photoslider.src=photos[which]
    playeffect()
    keeptrack()
    }
    }
    
    
    function forward(){
    if (which<photos.length-1){
    which++
    applyeffect()
    document.images.photoslider.src=photos[which]
    playeffect()
    keeptrack()
    }
    }
    
    function transport(){
    window.location=photoslink[which]
    }
    Last edited by keyboard; 01-02-2013 at 07:48 PM. Reason: Format: Code Tags [code][/code]

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Can you post the link to the DD demo page please?

    Thank you
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Someone else developed the website and I was just asked to modify it, I noticed that the previous user had used DD's services, so I have no real access to the link or code that they used besides the one I posted in the thread. Ill try to look for it though.

  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

    That's:

    http://www.dynamicdrive.com/dynamici...dhtmlslide.htm

    And you don't even have all of the code for it in your post. Assuming it works, the other part of the code for it must be in the body of the page you're using it on.

    I would recommend updating to a more robust slideshow like:

    http://www.dynamicdrive.com/dynamici...nslideshow.htm

    But to simply get the current script to be able to go back to the beginning:

    Code:
    /***********************************************
    * DHTML slideshow script-  ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice must stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    var photos=new Array()
    var photoslink=new Array()
    var which=0
    
    //define images. You can have as many as you want:
    photos[0]=["./images/slide01.png"]
    photos[1]=["./images/slide02.png"]
    photos[2]=["./images/slide03.png"]
    photos[3]=["./images/slide04.png"]
    photos[4]=["./images/slide05.png"]
    photos[5]=["./images/slide06.png"]
    photos[6]=["./images/slide07.png"]
    photos[7]=["./images/slide08.png"]
    photos[8]=["./images/slide09.png"]
    photos[9]=["./images/slide10.png"]
    
    //Specify whether images should be linked or not (1=linked)
    var linkornot=0
    
    //Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
    
    //do NOT edit pass this line
    
    var preloadedimages=new Array()
    for (i=0;i<photos.length;i++){
    preloadedimages[i]=new Image()
    preloadedimages[i].src=photos[i]
    }
    
    
    function applyeffect(){
    if (document.all && photoslider.filters){
    photoslider.filters.revealTrans.Transition=6
    photoslider.filters.revealTrans.stop()
    photoslider.filters.revealTrans.apply()
    }
    }
    
    
    
    function playeffect(){
    if (document.all && photoslider.filters)
    photoslider.filters.revealTrans.play()
    }
    
    function keeptrack(){
    window.status="Image "+(which+1)+" of "+photos.length
    }
    
    
    function backward(){
    which = which > 0? which : photos.length - 1;
    if (which>0){
    which--
    applyeffect()
    document.images.photoslider.src=photos[which]
    playeffect()
    keeptrack()
    }
    }
    
    
    function forward(){
    which = which < photos.length - 1? which : 0;
    if (which<photos.length-1){
    which++
    applyeffect()
    document.images.photoslider.src=photos[which]
    playeffect()
    keeptrack()
    }
    }
    
    function transport(){
    window.location=photoslink[which]
    }
    - John
    ________________________

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

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Srod2357 (01-02-2013)

  6. #5
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    That did it! Thanks a million!

Similar Threads

  1. Replies: 2
    Last Post: 08-30-2009, 04:50 PM
  2. Replies: 13
    Last Post: 05-25-2007, 04:15 AM
  3. Random number addition script - help!
    By Shenshen in forum JavaScript
    Replies: 1
    Last Post: 05-23-2006, 06:17 PM
  4. Daily iFrame Content II Script Addition
    By purplehazeir in forum Dynamic Drive scripts help
    Replies: 11
    Last Post: 10-07-2005, 11:59 AM
  5. getAttribute addition to slideshow script?
    By techhietim in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 05-26-2005, 02:54 PM

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
  •