Changing Between Still and Motion Images : Image Img « HTML « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Dojo toolkit
7. Event
8. Event onMethod
9. Ext JS
10. Form Control
11. GUI Components
12. HTML
13. Javascript Collections
14. Javascript Objects
15. Javascript Properties
16. jQuery
17. Language Basics
18. Mochkit
19. Mootools
20. Node Operation
21. Object Oriented
22. Page Components
23. Rico
24. Scriptaculous
25. Security
26. SmartClient
27. Style Layout
28. Table
29. Utilities
30. Window Browser
31. YUI Library
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
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
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
JavaScript DHTML » HTML » Image Img 
Changing Between Still and Motion Images
  
<HTML>
<HEAD>
<TITLE>IMG dynsrc Property</TITLE>
<SCRIPT LANGUAGE="JavaScript">
var trainImg = new Image(160,120)
trainImg.src = "http://www.java2java.com/style/logo.png"
trainImg.dynsrc = "http://www.java2java.com/style/logoRed.png"

function setLoop() {
    var selector = document.forms[0].looper
    document.myIMG.loop = selector.options[selector.selectedIndex].value
}
function setImage(type) {
    if (type == "jpg") {
        document.myIMG.dynsrc = ""
        document.myIMG.src = trainImg.src
    else {
        document.myIMG.src = ""
        document.myIMG.start = "fileopen"
        setLoop()
        document.myIMG.dynsrc = trainImg.dynsrc
    }
}
</SCRIPT>
</HEAD>
<BODY>
<H1>IMG dynsrc Property</H1>
<HR>
<FORM>
Choose image type: 
<INPUT TYPE="radio" NAME="imgGroup" CHECKED onClick="setImage('png')">Still
<INPUT TYPE="radio" NAME="imgGroup" onClick="setImage('mpg')">Video
<P>Play video how many times after loading: 
<SELECT NAME="looper" onChange="setLoop()">
    <OPTION VALUE=SELECTED>Once
    <OPTION VALUE=2>Twice
    <OPTION VALUE=-1>Continuously

</SELECT></P>
</FORM>
<HR>
<IMG NAME="myIMG" SRC="http://www.java2java.com/style/logo.png" HEIGHT=120 WIDTH=160>
</BODY>
</HTML>


           
         
    
  
Related examples in the same category
1. Get the file name specified in the href or src property
2. Image dynsrc
3. Low resolution Image src
4. Image Long Description
5. Image width Example
6. Does image download completely
7. Alternative Information Example
8. Image align Example
9. Image 'src' Property
10. 'height' Example
11. 'readyState' Example
12. 'galleryImg' Example
13. Monitors the load process and the display of pictures
14. Image Animation
15. Image array
16. Replace image
17. An animating image
18. Mouse in image and out
19. Scrolling Image
20. Change the height of an image
21. Change image
22. Change image width
23. Count images in a document
24. Image Event Handling
25. Methods and Properties of the Image Object
26. Testing an Image's align Property
27. A Scripted Image Object and Rotating Images
28. Scripting image.complete
29. Simple Image Replacement
30. Image Error Finder
31. Image element
32. Image Roller Machine
33. Change image in mouse in and out event
34. Use array to store the image names
35. Img onmouseover and onmouseout actions
36. Change vspace for image
37. Change image src
38. Set image height
39. Set image alt message
40. Change image align
41. Change image title
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.