Forum Moderators: open

Message Too Old, No Replies

DHTML - RotateImages() coding question

Trying to have a random dissolve transition EFFECT for a 20-pix screen save

         

larsi

6:12 pm on Dec 2, 2002 (gmt 0)



Hello. I am new to this site and am thrilled to know that something like the exists. I have spent about 30 hours trying to complete this task. I know it must seem easy but I am a beginner. I'm trying to keep it simple but I'm getting very confused. Can someone please help me? I am trying to create a slide show for screensaver with a random dissolve transition. There are 20 picutres altogether which will rotate. They are called “Picture001.jpg”, “Pictue002.jpg” and so on and so forth. I HAVE to use the RotateImages() function. I believe everything is correctly written below except for the RotateImages() function, which I can’t seem to do. I have left this area blank, so as to not confuse everyone who is reviewing this, with all of my previous attempts. THANK YOU!

<HTML>
<HEAD>
<TITLE>screen saver slide show</TITLE>
<SCRIPT>

var intCount=2

function RotateImages()
{

}

function StartTrans()
{
setInterval("RotateImages()", 1000);
}

</SCRIPT>
</HEAD>
<BODY onLoad="StartTrans();">

<IMG SRC="Picture001.jpg" ID=Img1 BORDER=1 WIDTH=100% Height=100% STYLE="visibility: visible; filter: revealTrans(Duration=20, Transition=12)">

</BODY>
</HTML>

BlobFisk

6:33 pm on Dec 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome [webmasterworld.com] to WebmasterWorld, larsi.

<!--
This file retrieved from the JS-Examples archives
[js-examples.com...]
100s of free ready to use scripts, tutorials, forums.
Author: JS-Examples - [js-examples.com...]
-->

<script>
var n=0;
var a=null;
var imgs = new Array();
imgs[0] = new Image(); imgs[0].src = "pic1.gif";
imgs[1] = new Image(); imgs[1].src = "pic2.gif";
imgs[2] = new Image(); imgs[2].src = "pic3.gif";
function rotate(){
n=(n+1)%3;
document.p1.src=imgs[n].src;
if(a==null)a=setInterval("rotate()",300);
}
</script>

<img name=p1 width=25 height=25 src="pic4.gif">

This would negate the use of your second function calling the interval.

HTH