472,794 Members | 3,391 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,794 software developers and data experts.

dhtml text fader prob, please help!

Hi, im looking for help on how to add a text fader to my website,
usually i'm working with css but in this case i need to add java script
to make it work, that wasn't the problem but somehow it seems like they
are not compatible with each other so when i add the text fader code in
the <body> tag,the rest of my site is gone :S if someone please can
have a look at my code and tell what am i doing wrong.
thx allot for whom of you who can =)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

<SCRIPT LANGUAGE="javascript" TYPE="text/javascript">

var loop = true; // toggle on/off
var xpos = "120"; // left distance
var ypos = "30"; // top distance
var wide = "565"; // layer width
var rate = "250"; // change speed

var tnum = "1";
var t = new Array();
t[1] = ".....100% Natural 100% Natural 100% Natural 100% Natural 100%
Natural.....";
t[2] = "...Shop Online...";
t[3] = ".... Grow Your Own !";

var cnum = "1";
var c = new Array();
c[1] = "lightgreen";
c[2] = "gray";
c[3] = "silver";
c[4] = "whitesmoke";
c[5] = "white";
c[6] = "white";
c[7] = "white";
c[8] = "whitesmoke";
c[9] = "silver";
c[10] = "gray";
c[11] = "green";
c[12] = "lightgreen";

if(document.layers)document.write("<layer name='hi' left='"+xpos+"'
top='"+ypos+"' width='"+wide+"'></layer>");
if(document.all)document.write("<div id='hi'
style='position:absolute;left:"+xpos+";top:"+ypos+ ";width:"+wide+"'>");

function glow()
{
if(document.layers)
{
if(tnum < t.length)
{
if(cnum < c.length-1)
{
document.layers["hi"].document.write("<font size=5
color='"+c[cnum]+"'>"+t[tnum]+"</font>");
document.layers["hi"].document.close();
cnum++;
}

else
{
cnum = 1;
tnum++;
if(loop)
{
if(tnum == t.length) tnum = 1;
}
}

setTimeout("glow()",rate);
}

else
{
document.layers["hi"].document.write("");
document.layers["hi"].document.close();

}
}

if(document.all)
{
if(tnum < t.length)
{
if(cnum < c.length-1)
{
document.all("hi").innerHTML = "<font size=3 font face=Arial,
Helvetica, sans-serif color='"+c[cnum]+"'>"+t[tnum]+" </font>";
cnum ++;
}

else
{
cnum = 1;
tnum ++;
if(loop)
{
if(tnum == t.length) tnum = 1;
}
}

setTimeout("glow()",rate);
}

else document.all("hi").innerHTML = "";

}
}

</SCRIPT>

<style type="text/css">
body{background-color:#000000}
#headline{position:absolute; left:-2px; top: 13px; margin: 10px 200px
500px 10px}

#navbar
{
position:absolute;
left:76px;
top: 112px;
list-style: none;
padding: 2px;
padding-left : 1.5em;
padding-right : 1.5em;
margin: 1px 1px 1px 1px;
white-space: nowrap;
background: #000;
text-align: right;
line-height: 1.2em;

}

#navbar a.xxx {
padding-left : 1em;
padding-right : 1em;
color: #25BC5F;
background-color: #000;
border-top: 1px solid #333333;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #333333;
text-decoration: none;}

#navbar a:hover.xxx {
color: #25BC5F;
background-color: #333;
border-top: 1px solid #000;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #000;}

p{font-color:#F0F0F0;
font-size:10px;
font-face:Arial, Helvetica, sans-serif;}

#intro{position:absolute;
left:911px;
top:119px;
width:8%;
letter-spacing:0.03cm;}

#natural{position:absolute;left:444px;top:707px}

..container{
position:absolute;
margin: auto;
width: 600px;
height:600px;
padding-left:20px;
padding-right:20px;
border-left:1px solid #333;
border-right:1px solid #333;
left: 284px;
top: 114px;

}

#content{position:absolute;
left:168px;
top:34px;
width:53%;
letter-spacing:0.03cm;
border-style:solid;
border-color:#333333;
border-width:1px;
padding:3%;}
#content img
{
float:left;
margin:6px 10px 90px 10px;
left:200px;
top:270px;}

#content1{position:absolute;
left:168px;
top:194px;
width:53%;
letter-spacing:0.03cm;
border-style:solid;
border-color:#333333;
border-width:1px;
padding:3%;}

#content1 img
{
float:left;
margin:6px 10px 90px 10px;
left:200px;
top:350px;}

</style>

</head>

<BODY onLoad='glow()'>

<div id="headline">
<img src="images/mnbanner1.jpg"/></div>

<div id="navbar"><font face="Terminator Two" size="2">

<a href="index1.htm" class="xxx">Home</a><br><br>
<a href="index2.htm" class="xxx">Flowers</a><br><br>
<a href="index3.htm" class="xxx">Herbs</a><br><br>
<a href="index4.htm" class="xxx">Order Info</a><br><br>
<a href="index5.htm" class="xxx">Order Form</a><br><br>
<a href="index6.htm" class="xxx">Contact</a><br><br>

</font></div>

<div id="intro">
<p><font color="F0F0F0" size="2" face="Terminator Two">Mushrooms</font>
<font color="#F0F0F0" size="1" face="Arial, Helvetica, sans-serif"><br>
Grow your own , it's fast and easy, you'll be surprised to have results
with no time.</font>
</p></div>

<div class="container">

<div id="content">
<img src="images/waterlily.jpg" width="80" height="100" />
<p><font color="#F0F0F0" size="1" face="Arial, Helvetica,
sans-serif">This strain is known as the most predominant, it produces
small fruits but considered
one of the strongest producers.
This species grows very fast, translucent when young, then turning
gray to white.
Growing instructions included.<br>
Please add it to my <a href="ordertest2.php"
target="_blank">order</a></font>
</p></div>

<div id="content1">
<p>
<img src="images/tulip.jpg"
width="80" height="100" />
<font color="#F0F0F0" size="1" face="Arial, Helvetica, sans-serif">The
This strain is the most famous in the world from primitive ages till
today.
Strong thin and tall potent producer.
Growing instructions included.<br>
Please add it to my <a href="ordertest2.php"
target="_blank">order</a></font>
</p>

</div>
</div>

<div id="natural">
<img src="images/100natural.jpg"/></div>

</body>
</html>

Jul 23 '05 #1
4 1798
this is pretty cool, works in my ie6, netscape7.2, firefox1.0.1

http://www.bosiljak.hr/fadermaker/
Jul 23 '05 #2
mscir wrote:
this is pretty cool, works in my ie6, netscape7.2, firefox1.0.1

http://www.bosiljak.hr/fadermaker/


Too bad your etiquette of quoting what you are replying doesn't work.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #3
Randy Webb wrote:
mscir wrote:
this is pretty cool, works in my ie6, netscape7.2, firefox1.0.1
http://www.bosiljak.hr/fadermaker/


Too bad your etiquette of quoting what you are replying doesn't work.


Apologies to all concerned.

Mike
Jul 23 '05 #4
an******@hotmail.com wrote:
Hi, im looking for help on how to add a text fader to my website,
usually i'm working with css but in this case i need to add java script
to make it work, that wasn't the problem but somehow it seems like they
are not compatible with each other so when i add the text fader code in
the <body> tag,the rest of my site is gone :S if someone please can
have a look at my code and tell what am i doing wrong.
thx allot for whom of you who can =)


This version of your code works in my IE 6, Netscape 7.2, Firefox 1.0.1.
I just placed a div id='hi' at the top of the page, used CSS to position
and size it, and modified your code to rewrite the innerHTML in the glow
function. (I didn't check to see if it's valid, just tried to get the
code working).

Mike

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<SCRIPT TYPE="text/javascript">
var loop = true; // toggle on/off
var rate = "250"; // change speed
var tnum = "1";
var t = new Array();
t[1] = ".....100% Natural 100% Natural 100% Natural 100% Natural 100%
Natural.....";
t[2] = "...Shop Online...";
t[3] = ".... Grow Your Own !";
var cnum = "1";
var c = new Array();
c[1] = "lightgreen";
c[2] = "gray";
c[3] = "silver";
c[4] = "whitesmoke";
c[5] = "white";
c[6] = "white";
c[7] = "white";
c[8] = "whitesmoke";
c[9] = "silver";
c[10] = "gray";
c[11] = "green";
c[12] = "lightgreen";
function start(){
hidiv=document.getElementById('hi');
glow()
}
function glow(){
if(tnum < t.length){
if(cnum < c.length-1){
hidiv.innerHTML = "<font color='"+c[cnum]+"'>"+t[tnum]+" </font>";
//document.getElementById('hi').innerHTML ="test";// "<font
color='"+c[cnum]+"'>"+t[tnum]+" </font>";
cnum++;
}else{
cnum = 1;
tnum++;
if(loop){
if(tnum == t.length) tnum = 1;
}
}
setTimeout("glow()",rate);
}
}
</SCRIPT>

<style type="text/css">
body{background-color:#000000}
#hi{
left: 120px;
top: 30px;
width: 565px;
font-size: 90%;
position: absolute;
}
#headline{position:absolute; left:-2px; top: 13px; margin: 10px 200px
500px 10px}

#navbar{
position:absolute;
left:76px;
top: 112px;
list-style: none;
padding: 2px;
padding-left : 1.5em;
padding-right : 1.5em;
margin: 1px 1px 1px 1px;
white-space: nowrap;
background: #000;
text-align: right;
line-height: 1.2em;
}

#navbar a.xxx {
padding-left : 1em;
padding-right : 1em;
color: #25BC5F;
background-color: #000;
border-top: 1px solid #333333;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #333333;
text-decoration: none;}

#navbar a:hover.xxx {
color: #25BC5F;
background-color: #333;
border-top: 1px solid #000;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
border-left: 1px solid #000;}

p{font-color:#F0F0F0;
font-size:10px;
font-face:Arial, Helvetica, sans-serif;}

#intro{position:absolute;
left:911px;
top:119px;
width:8%;
letter-spacing:0.03cm;}

#natural{position:absolute;left:444px;top:707px}

..container{
position:absolute;
margin: auto;
width: 600px;
height:600px;
padding-left:20px;
padding-right:20px;
border-left:1px solid #333;
border-right:1px solid #333;
left: 284px;
top: 114px;

}

#content{position:absolute;
left:168px;
top:34px;
width:53%;
letter-spacing:0.03cm;
border-style:solid;
border-color:#333333;
border-width:1px;
padding:3%;}
#content img
{
float:left;
margin:6px 10px 90px 10px;
left:200px;
top:270px;}

#content1{position:absolute;
left:168px;
top:194px;
width:53%;
letter-spacing:0.03cm;
border-style:solid;
border-color:#333333;
border-width:1px;
padding:3%;}

#content1 img
{
float:left;
margin:6px 10px 90px 10px;
left:200px;
top:350px;}

</style>

</head>

<BODY onLoad='start()'>
<div id='hi'></div>

<div id="headline">
<img src="images/mnbanner1.jpg"/></div>

<div id="navbar"><font face="Terminator Two" size="2">

<a href="index1.htm" class="xxx">Home</a><br><br>
<a href="index2.htm" class="xxx">Flowers</a><br><br>
<a href="index3.htm" class="xxx">Herbs</a><br><br>
<a href="index4.htm" class="xxx">Order Info</a><br><br>
<a href="index5.htm" class="xxx">Order Form</a><br><br>
<a href="index6.htm" class="xxx">Contact</a><br><br>

</font></div>

<div id="intro">
<p><font color="F0F0F0" size="2" face="Terminator Two">Mushrooms</font>
<font color="#F0F0F0" size="1" face="Arial, Helvetica, sans-serif"><br>
Grow your own , it's fast and easy, you'll be surprised to have results
with no time.</font>
</p></div>

<div class="container">

<div id="content">
<img src="images/waterlily.jpg" width="80" height="100" />
<p><font color="#F0F0F0" size="1" face="Arial, Helvetica,
sans-serif">This strain is known as the most predominant, it produces
small fruits but considered
one of the strongest producers.
This species grows very fast, translucent when young, then turning
gray to white.
Growing instructions included.<br>
Please add it to my <a href="ordertest2.php"
target="_blank">order</a></font>
</p></div>

<div id="content1">
<p>
<img src="images/tulip.jpg"
width="80" height="100" />
<font color="#F0F0F0" size="1" face="Arial, Helvetica, sans-serif">The
This strain is the most famous in the world from primitive ages till
today.
Strong thin and tall potent producer.
Growing instructions included.<br>
Please add it to my <a href="ordertest2.php"
target="_blank">order</a></font>
</p>

</div>
</div>

<div id="natural">
<img src="images/100natural.jpg"/></div>

</body>
</html>
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nick | last post by:
Does a background fader work by... A) Changing the color after a long 'loop' statement??? B) Changing the color, then waiting a bit, then changing the color again??? To me it seems B...
0
by: Mamatha | last post by:
Hi I am developing a small video capture application in C#.net. I want to develop this application like "winamp",means i want to display VUlevel meters and FADER. I want controls in .net for...
2
by: Freightliner | last post by:
Hi, this script here displays a fading text message. I would like to display 3 different messages, let's say "Fading text 1", "Fading text 2", "Fading text 3". Also, is there a way to make it...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.