Total members 11895 |It is currently Thu Dec 26, 2024 7:29 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Hi! I'd need some helps with my JavaScript. I want three texts to fade in and fade out after each other in different places. Currenlty the texts fade in as I want, but then thet stay there and don't fade out. I know there's some faults in my code but I'm not adequately good to know how to correct it. Thank you

<div id="fader" style="font:15px Calibri;width:43%; color:rgb(255,255,255);" class="style3"></div><br/>
<span lang="fi">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>
<br/><div id="fader2" style="font:15px Calibri;width:45%; color:rgb(255,255,255); float:right" class="style1"></div><br/><br/>
<span lang="fi">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div id="fader3" style="font:15px Calibri;width:51%; color:rgb(255,255,255);" class="style2"></div>
</span>
</div>

<td id="spacertd" width="15"></td>
<td id="rightcolumn" valign="top">

<script language="JavaScript1.2">
opacity = 0.0;
var inc=-1;

function fadingtext(){
if(opacity != 1.0) {
opacity += 0.1;
document.getElementById("fader").style.opacity = opacity;
document.getElementById("fader2").style.opacity = opacity;
document.getElementById("fader3").style.opacity = opacity;
setTimeout("fadingtext()",20);
}
else
opacity = 0.0;
}

function changetext(){
if (!document.getElementById) return
inc++
if (inc==0)
document.getElementById("fader").innerHTML="Text1"
else if (inc==1)
document.getElementById("fader2").innerHTML="Text2"
else{
document.getElementById("fader3").innerHTML="Text3"
inc=-1
}
fadingtext()
setTimeout("changetext()",2300)
}
window.onload=changetext

</script>




Author:
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : JavaScript fade out problem
 Fade-In, Fade-out and Fade-toggle with time control     -  
 Problem with BMI calcualtor in JavaScript     -  
 I'm having a problem creating a Javascript form. Whats wrong     -  
 MVC problem....     -  
 i have problem     -  
 Problem with skymiles_red     -  
 Map Class problem     -  
 Skymiles [3.04] little? problem     -  
 Paging problem in php     -  
 JSTL URI problem     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com