Hellusius Posted August 11, 2006 Share Posted August 11, 2006 I am making a slideshowScript: (in head of file)[code]<script language=javascript><!-- Slideshow scriptvar 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>[/code]and html:[code]<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>[/code]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 =) Quote Link to comment Share on other sites More sharing options...
radalin Posted August 11, 2006 Share Posted August 11, 2006 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:[code]<script language=javascript><!-- Slideshow scriptvar 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>[/code] and while your html code changes a little bit to:[code]<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>[/code]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 Quote Link to comment Share on other sites More sharing options...
Hellusius Posted August 12, 2006 Author Share Posted August 12, 2006 going to check that tommorow, thanks for the suggestions already =) Quote Link to comment Share on other sites More sharing options...
Hellusius Posted August 14, 2006 Author Share Posted August 14, 2006 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.