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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continuous "slideshow" Loop Problems

Status
Not open for further replies.

DavidC271

Technical User
Jul 30, 2002
17
US
I’m trying to modify Microsoft's DXImageTransform.Fade() code from having to use a toggle button to loading it on startup and having it loop continuously.
I'll be honest; I do not really know JavaScript that well so I really don't know where to begin.
Here is the code MS provides:

Code:
<SCRIPT>
var startImage ="fruit.gif";
var endImage="mouse.gif";
function doTrans() {
        
        imgObj.filters[0].apply();
        if (oImg.src.indexOf(startImage)!=-1) {
            oImg.src = endImage;
            imgObj.style.backgroundColor = "gold";
            imgObjText.innerHTML =             "<BR><B>Second Page</B><BR><BR>Using the <B>play</B> method reveals the changes in the SPAN element content."        }
        else {
            oImg.src = startImage;
            imgObj.style.backgroundColor = "skyblue";
            imgObjText.innerHTML =             "<BR><b>First Page</b><BR><BR>Using the <B>apply</B> method prepares this SPAN element for content changes."        }
        imgObj.filters[0].play();
}
</SCRIPT>
</HEAD>
<BODY>
<SPAN style="FILTER: progid:DXImageTransform.Microsoft.Fade(Overlap=1.00); BACKGROUND-COLOR: skyblue; PADDING-LEFT: 13px; WIDTH: 305px; PADDING-RIGHT: 10px; FONT: 9pt/1.3 verdana; HEIGHT: 150px; COLOR: black" id=imgObj><IMG style="MARGIN: 8px" id=oImg align=left src="fruit.gif">
<DIV id=imgObjText><BR><B>First Page</B><BR><BR>Using the <B>apply</B> method prepares this SPAN element for content changes.</DIV></SPAN><BR><BR>
<BUTTON onclick="doTrans()">Play Transition</BUTTON>
</BODY>
I have tried:
Repeat() {
setTimeout(doTrans(), 3000);
}
and added Repeat(); to the end of doTrans() but I get a memory overflow error after 3 seconds pointing to the "imgObj.filters[0].apply();" line of doTrans()


Any help would be greatly appreciated.

Thanks,
David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top