Jump to content


Photo

Slideshow


  • Please log in to reply
3 replies to this topic

#1 Hellusius

Hellusius
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts

Posted 11 August 2006 - 12:17 AM

I am making a slideshow

Script: (in head of file)
<script language=javascript>
<!-- Slideshow script
var slide = new Array("TR(trailer)0.jpg","TR(trailer)1.jpg","TR(trailer)2.jpg","TR(trailer)3.jpg","TR(trailer)4.jpg")
var presentSlide=0

 function previous( ) {  
  if (document.images && presentSlide > 0) {  
       presentSlide = presentSlide -1   
       document.slideshow.src=slide[presentSlide] 
       }   
     }  

 function next( ) {  
  if (document.images && presentSlide < 4) {  
       presentSlide = presentSlide +1   
       document.slideshow.src=slide[presentSlide] 
       }  
     }  
  // End Slideshow script -->
</script>

and html:
<table width="1000" align="center">
  <tr>
    <td>
<font color="#BF5500" size="4">The Return's Slideshow</font>
<img src="tropic.jpg" name="slideshow"><p>
<size="4">
<a href =  javascript:previous( ) > Previous</A>  
<a href =  javascript:next( ) > Next</A>
    </td>
  </tr>
</table>

Does for some apperent reason not work, the screenshots are not even displayed even though they are uploaded on the ftp.

suggestions on this issue would be muxh appreciated, thanks in advance =)


#2 radalin

radalin
  • Members
  • PipPipPip
  • Advanced Member
  • 179 posts

Posted 11 August 2006 - 09:05 AM

well first of all use ' href="javascript::previous()" ' . Always use dobule quotes as this is proper coding.
Secondly, instead of using ' document.slideshow ' use ' document.getElementById('slideshow') ' and  add to the img tag an id property like: ' <img src="tropic.jpg" name="slideshow" id="slideshow"> ' .
If these things does not help and still nothing changes I can suggest using something like this as javascript:
<script language=javascript>
<!-- Slideshow script
var slide = new Array("TR(trailer)0.jpg","TR(trailer)1.jpg","TR(trailer)2.jpg","TR(trailer)3.jpg","TR(trailer)4.jpg")
var presentSlide=0

 function previous( ) {  
  if (document.images && presentSlide > 0) {  
       presentSlide = presentSlide -1   
       document.getElementById('slideSpan').innerHTML = '<img src="'+ slide[presentSlide] + '" id="slideshow" name="slideshow"> ' ;
       }   
     }  

 function next( ) {  
  if (document.images && presentSlide < 4) {  
       presentSlide = presentSlide +1   
       document.getElementById('slideSpan').innerHTML = '<img src="'+ slide[presentSlide] + '" id="slideshow" name="slideshow"> ' ; 
       }  
     }  
  // End Slideshow script -->
</script>

and while your html code changes a little bit to:
<table width="1000" align="center">
  <tr>
    <td>
<font color="#BF5500" size="4">The Return's Slideshow</font>
<span id="slideSpan"><img src="tropic.jpg" name="slideshow"></span><p>
<size="4">
<a href =  javascript:previous( ) > Previous</A>  
<a href =  javascript:next( ) > Next</A>
    </td>
  </tr>
</table>

I just changed the changing src to an innerHTML method. Well this code should work if I'm not missing something but you could also try your previous code by changing what I said before.
Hope that helps
Roy Simkes
Yet Another Parkyeri Developer

#3 Hellusius

Hellusius
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts

Posted 12 August 2006 - 12:29 AM

going to check that tommorow, thanks for the suggestions already =)

#4 Hellusius

Hellusius
  • Members
  • PipPipPip
  • Advanced Member
  • 55 posts

Posted 14 August 2006 - 07:39 AM

It worked so far, but now I am thinking of making a thing that if next is pressed at the last picture it will continu on the first picture again.
any idea's on this?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users