Slide Show : img « HTML Tags « JavaScript Tutorial

JavaScript Tutorial
1. Language Basics
2. Operators
3. Statement
4. Development
5. Number Data Type
6. String
7. Function
8. Global
9. Math
10. Form
11. Array
12. Date
13. Dialogs
14. Document
15. Event
16. Location
17. Navigator
18. Screen
19. Window
20. History
21. HTML Tags
22. Style
23. DOM Node
24. Drag Drop
25. Object Oriented
26. Regular Expressions
27. XML
28. GUI Components
29. Animation
30. MS JScript
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
JavaScript Tutorial » HTML Tags » img 
21. 9. 16. Slide Show
<HTML>
<HEAD>
<TITLE>Slide Show</TITLE>
</HEAD>
<BODY bgcolor=black text=white>
<SCRIPT>
var picArray = new Array("",1.jpg", "2.jpg", "3.jpg", "4.jpg","5.jpg","6.jpg","7.jpg","8.jpg","9.jpg","10.jpg");
var picIndex = 1;
var timeOutId;

function inOrder() {
   showPic(picIndex);   
   picIndex ++;
   if (picIndex > 10) 
       picIndex = 1;
   status = picIndex;
   timeOutId=setTimeout("inOrder();",1000);
}
function showRandom() {
   picIndex = Math.floor(Math.random() * 11);
   if (picIndex == 0)
      picIndex = 1;
   showPic(picIndex);   
   status = picIndex;
   timeOutId=setTimeout("showRandom();",1000);
}
function showPic(i) {
   document.images[0].src=picArray[i];
}
</SCRIPT>
<H1>View a slide show!</H1>
<FORM>
<TABLE>
<TR><TD>
<INPUT type=button value="Show in Order" name=theButton onClick="inOrder();">
</TD><TD>
<INPUT type=button value="Random and Repeat" name=theButton onClick="showRandom();">
</TD><TD>
<INPUT type=button value="Stop" name=theButton onClick="clearTimeout(timeOutId);">
</TD></TR>
</TABLE><BR>
</FORM>
<IMG name=slideshow src="6.jpg" width=500 border=5>
</BODY>
</HTML>
21. 9. img
21. 9. 1. Image
21. 9. 2. Image.border
21. 9. 3. Image.complete
21. 9. 4. Image.height
21. 9. 5. Image.hspace
21. 9. 6. Image.lowsrc
21. 9. 7. Image.name
21. 9. 8. Image.src
21. 9. 9. Image.vspace
21. 9. 10. Image.width
21. 9. 11. Change link image in mouse in and mouse out
21. 9. 12. Image substitute
21. 9. 13. Image load onerror event (IE)
21. 9. 14. Add onerror handler to image element within document element array (IE)
21. 9. 15. Replace an Image under mouse event (onMouseOver, onMouseOut)
21. 9. 16. Slide Show
www___.__j___av__a2___s___.___c___o_m | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.