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 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need Help with JS Slideshow Script

    The script below is supposed to let the user move through photos like a slideshow. But, the pictures will not load. Can someone help me with this script?

    First, I'll post the code:

    Code:
    <script language="Javascript"> 
    
    var photos=new Array()
    var photoslink=new Array()
    var which=0
    
    
    photos[0] = "RC1.jpg"
    photos[1] = "RC2.jpg"
    photos[2] = "RC3.jpg"
    photos[3] = "RC4.jpg"
    photos[4] = "RC5.jpg"
    photos[5] = "RC6.jpg"
    photos[6] = "RC7.jpg"
    photos[7] = "RC8.jpg"
    photos[8] = "RC9.jpg"
    
    var linkornot=0
    
    
    //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=Math.floor(Math.random()*23)
    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]
    }
    
    </script>
    And from the HTML:

    Code:
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="100%" colspan="2" height="22"><center>
    <script language="Javascript">
    if (linkornot==1)
    document.write('<a href="javascript:transport()">')
    document.write('<img src="'+photos[0]+'" name="photoslider" style="filter:revealTrans(duration=2,transition=23)" 
    border=0>')
    if (linkornot==1)
    document.write('</a>')
    </script>
    </center></td>
    
    </tr>
    <tr>
    <td width="50%" height="21"><p align="left">
    <input type="submit" name="prev" value="<" onClick="backward();return false"></td>
    <td width="50%" height="21">
    <input type="submit" name="next" value=">" onClick="forward();return false"></td>
    </tr>
    </table>
    Thank you experts.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,964
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Are the images located in the same location as that page?


  •  

    Posting Permissions

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