Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fading Images help needed

Status
Not open for further replies.

glenmac

Technical User
Jul 3, 2002
947
CA
Hi I want to fade images in and then out again. Can anyone help? I get them to apear and then fade out but can't get them to fade in then out. Here's what I have up to now.
Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;JavaScript&quot;>
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName==&quot;Netscape&quot;)&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function startTrans(){//function for fadein Image

        


        mainimage2.filters.blendTrans.Apply();
        mainimage2.style.visibility = &quot;visible&quot;;
        mainimage2.filters.blendTrans.Play()
        mainimage2.filters.blendTrans.Apply();
        mainimage2.style.visibility = &quot;hidden&quot;;
        mainimage2.filters.blendTrans.Play()
        mainimage3.filters.blendTrans.Apply();
        mainimage3.style.visibility = &quot;visible&quot;;
        mainimage3.filters.blendTrans.Play()
        mainimage3.filters.blendTrans.Apply();
        mainimage3.style.visibility = &quot;hidden&quot;;
        mainimage3.filters.blendTrans.Play()
        mainimage1.filters.blendTrans.Apply();
        mainimage1.style.visibility = &quot;visible&quot;;
        mainimage1.filters.blendTrans.Play()
        mainimage1.filters.blendTrans.Apply();
        mainimage1.style.visibility = &quot;hidden&quot;;
        mainimage1.filters.blendTrans.Play()
}
// -->
</script>

</head>

<body bgcolor=&quot;black&quot; text=&quot;White&quot; onload = &quot;startTrans();&quot;>
<Div align = &quot;center&quot;> <img src =&quot;Logo3.gif&quot; width = &quot;711&quot; height=&quot;52&quot;></div>
   <table align = &quot;center&quot;border = &quot;0&quot; cellspacing = &quot;10&quot; cellpadding = &quot;5&quot;>
    <tr><td valign =&quot;top&quot;><img src = &quot;Rick5Shrunk.jpg&quot; width = &quot;109&quot; height=&quot;115&quot; id=&quot;mainimage1&quot; style=&quot;filter:blendTrans(duration=4); visibility:hidden;&quot;></td>
      <td rowspan = &quot;2&quot;><img src = &quot;Rebhomeshrunk.jpg&quot;></td>
      <td><img src = &quot;DougSuppleShrunk.jpg&quot; width = &quot;109&quot; height=&quot;115&quot; id=&quot;mainimage2&quot; style=&quot;filter:blendTrans(duration=9); visibility:hidden;&quot;></td></tr>
    <tr><td><img src = &quot;robflanneryShrunk.jpg&quot; width = &quot;109&quot; height=&quot;115&quot;id=&quot;mainimage3&quot; style=&quot;filter:blendTrans(duration=12); visibility:hidden;&quot;></td>
        <td>5</td></tr>
   </table><br>
</body>
</html>
Any help would be much appreciated!
 
You will probably need a little javascript :
setTimeout(&quot;DoFadeAgain()&quot;,1000)

Calls DoFadeAgain function every second.
This line needs to be the last line of the function DoFadeAgain to continuously loop.


Vince
 
Tried using setTimeout(&quot;startTrans()&quot;,2000) all it did was stop the function after 2 seconds. It didn't loop. Am I missing something??
&quot;can't get them to fade in then fade out&quot;.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top