Changing Between Still and Motion Images : Image Img : HTML JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » 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.navioo.com/style/logo.png"
trainImg.dynsrc = "http://www.navioo.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.navioo.com/style/logo.png" HEIGHT=120 WIDTH=160>
</BODY>
</HTML>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo HTML
» Image Img