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

Cross fading with java applets?

Status
Not open for further replies.

blkatilla

Programmer
Oct 12, 2002
4
US
Hello all...

I've researched and found that a popular method of implementing cross fading is by incorporating a compiled
java class file along with parameter tags into a html
document. Until I'm proficient enough with java applets,
I would like to obtain a java class file along with the
associated html statements (which I can modify to suit my
needs).

I've searched the net at length and can only find cross fading code which has stamp someone's logo and and link on the final result. (done from the class file so it's unchangeble).

If I could get a class file and associated html code without
having to register it (to get rid of the imprint) I'd
be grateful. Thank you very much.

-Doug
 
Why an applet??
here is the javascript to fade 2 div's of course it doesn't work in mozzila (what does?) but you can probebly fix that by finding out that a div.filters.alpha.opacity is conviniantly named differently in this browser.

<div id=div1 style=&quot;FILTER: alpha(opacity=100); POSITION: absolute; TOP: 0; left: 0&quot;>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br>this is div1<br></div>
<div id=div2 style=&quot;FILTER: alpha(opacity=0); POSITION: absolute; TOP: 0; left: -1000&quot;><h1>this is div2</h1></div>
<script>
function fade(strInID, strOutID,intTimeSpan,intPixel){
var objIn = document.getElementById(strInID);
var objOut = document.getElementById(strOutID);
if(intTimeSpan!=null){
intPixel = 100 / (intTimeSpan/100);
setTimeout(&quot;fade('&quot; + strInID + &quot;','&quot; + strOutID + &quot;',null,&quot; + intPixel + &quot;);&quot;,100);
objIn.style.left = 0;
objIn.filters.alpha.opacity = objIn.filters.alpha.opacity + intPixel;
objOut.filters.alpha.opacity = objOut.filters.alpha.opacity - intPixel;
} else {
objIn.filters.alpha.opacity = objIn.filters.alpha.opacity + intPixel;
objOut.filters.alpha.opacity = objOut.filters.alpha.opacity - intPixel;
if(objOut.filters.alpha.opacity<0){
objOut.style.left = -1000;
alert('done');
}else{
setTimeout(&quot;fade('&quot; + strInID + &quot;','&quot; + strOutID + &quot;',null,&quot; + intPixel + &quot;);&quot;,100);
}
}
}
fade('div2','div1',5000,null);
//the next fade goes faster (2 seconds)
//fade('div2','div1',2000,null);
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top