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!

How do i dynamically change the innerHTML on my marquee

Status
Not open for further replies.

manvee1

Programmer
Jul 17, 2002
22
US
<p><A onMouseOver="mainform.all.myscroller.innerHTML=js function returning a string" href="<p><A onMouseOver="mainform.all.myscroller.innerHTML=js function returning another string” href="
i tried to make function to create the string and return the string when called but it did not work.

then i made the function create the string anyway at loadup and then just tried to insert the variable/obj...
onMouseOver="mainform.all.myscroller.innerHTML=variable"
but that did not work either even after i embedded variable in javascript tag/comment.

what am i doing wrong?

thanks,
Manvee1
 
code is uncomplete but heres a piece that works...
my idea is to get the function create different msgs and use the mouse action to request msg 4 printing in marquee.
thanks,
manvee1

<html>
<head>
<meta NAME="GENERATOR" Content="">
<title></title>
<SCRIPT LANGUAGE = "JavaScript">
<!-- HTML comment to placate non JavaScript capable browsers
/*
function msgScroller()
{
var srt = new Array();
srt[1] = "<h3>" + "Admin Tools" + "</h3>";
srt[2] = "12 App Client " + "<br>\n";
srt[3] = "13 App Client " + "<br>\n";
srt[4] = "103 App Client " + "<br>\n";
srt[5] = "013 App Client " + "<br>\n";
srt[6] = "130 App Client " + "<br>\n";
srt[7] = "0013 App Client " + "<br>\n";
srt[8] = "14 App Client " + "<br>\n";
srt[9] = "104 App Client" + "<br>\n";
srt[10] = "Adobe Acrobat 4" + "<br>\n";
srt[11] = "App Demo 1 " + "<br>\n";
srt[12] = "Training" + "<br>\n";
srt[13] = "Word 97" + "<br>\n";
srt[14] = "Word 00" + "<br>\n";
srt[15] = "Desktops" + "<br>\n";
srt[16] = "000 App Client" + "<br>\n";
srt[17] = "MS Word" + "\n";
srt[18] = "Admin Tools" + "<br>\n";

for (x = 1; x <= 18; x++)
{
strMsg += srt[x];
}
return strMsg;
}
msgScroller();

// -->
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; "></head>
<body tracingsrc="" tracingopacity="100">
<form name = "mainform" ACTION = " ">
<p><A onMouseOver="mainform.all.myscroller.innerHTML='string inserted by msgScroller() or strMsg variable'" href="<p><A onMouseOver="mainform.all.myscroller.innerHTML='or build string here with styles etc'" href="<p><A onMouseOver="mainform.all.myscroller.innerHTML='another string maybe with same function'" href="Contents<BR>
<marquee ID="myscroller" scrollamount="3" height= 100 width="250" behavior="" direction="up" bgcolor="blue"
loop="15" style="color:white" >Pls change me on mouseaction</marquee><hr>
<DIV></DIV></div>
</form>
</body>
</html>
 
what a mess.

don't use the "all" collection. instead, use getElementById.

Code:
document.getElementById("myscroller").innerHTML = "whatever i want to appear in the marquee";



*cLFlaVA
----------------------------
[tt]mr. pibb + red vines = crazy delicious![/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
single line txt works but i need multi line with styles. hence i need to build a string and print.
any ideas/
thanks,
Manvee1
 
Couldn’t create the string dynamically so I had to type string in for each mouseover like this

<p><A onMouseOver="mainform.all.myscroller.innerHTML='<h3>Admin Tools</h3> Client 1<br> Client 2<br> Client 3<br> etc...'"

thanks
manvee1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top