please help me with image slideshow

Discussion in 'JavaScript' started by tammytas, Feb 11, 2011.

  1. #1
    how to do image slideshow (swap images)....
     
    tammytas, Feb 11, 2011 IP
  2. DmitryS

    DmitryS Active Member

    Messages:
    79
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    you should better use jquery. lods are exmaples can be seen on google
     
    DmitryS, Feb 11, 2011 IP
  3. pHrEaK

    pHrEaK Active Member

    Messages:
    147
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    This is an example I made for a project in class

    The code for said example:

    <!DOCTYPE html
       PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <title>Racecore</title>
    <script type="text/javascript">
    <!-- Hide from old browsers
    
    var slides=new Array("gsx.png","fox.png","stealth.png","bike.png","4g.png")
    
    var slideCntr=slides.length-1
    function slideShow() {
    	slideCntr+=1
    	if (slideCntr==slides.length) slideCntr=0
    	document.slideHolder.src = slides[slideCntr]
    	setTimeout("slideShow()",2000)
    	}
    //-->
    </script>
    </head>
    
    <body onload="slideShow()" style="background-color: black">
    <table width="100%" height="100%">
    	<tr>
    		<td width="100%" height="100%" align="center">
    			<table border="0" cellpadding="225" cellspacing="0">
    				<tr>
    					<td><a href="http://www.racecore.com">
    						<img id="slideHolder" style="border-style: solid; border-width: 5px; border-color: black" src="gsx.png"></a>
    					</td>
    				</tr>
    			</table>
    		</td>
    	</tr>
    </table>
    
    <div style="text-align: center">
    	<a href="http://www.racecore.com">
    		<p style="color: #999999">Enter Racecore.com</p>
    	</a>
    </br>
    <p style="color: #999999">The place to be for discount performance accessories and a wide collection of information.</p>
    </div>
    
    
    
    </body>
    </html>
    Code (markup):
    Hope that helps
     
    pHrEaK, Feb 14, 2011 IP