Click to See Complete Forum and Search --> : MARQUE Loop on layer


DanielMorley
04-25-2007, 01:46 PM
I am trying to get a marque loop to work on a layer. This program generates dynamic characters however when I put a Marque loop on it. The program fails. :)


<html>
<head>


<title>Accuator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="30" >
<HEAD>
<SCRIPT language="JavaScript">
<!--







if (document.images)
{
pic1on= new Image(125,167);
pic1on.src="images/accuatorII.gif";

pic1off= new Image(167,125);
pic1off.src="images/accuatorIII.gif";
}

function lightup(imgName)
{
if (document.images)
{
imgOn=eval(imgName + "on.src");
document[imgName].src= imgOn;
}
}

function turnoff(imgName)
{
if (document.images)
{
imgOff=eval(imgName + "off.src");
document[imgName].src= imgOff;
}
}

//-->
</SCRIPT>
</HEAD>



</head>


<body bgcolor="#FFFFFF" text="#000000">
<A HREF="www.google.com" onMouseover="lightup('pic1')" onMouseout="turnoff('pic1')">
<IMG SRC="images/accuator.gif" name="pic1" width="167" height="125" border="5"></A>
<FORM name="myform">

<HTML>
<BODY onLoad="countdown();">
<div name="fred" id="fred" style="position:absolute;top:0;left:20;"></div><BR>
<MARQUEE LOOP="infinite" BGCOLOR="yellow" WIDTH="1300">:(
Scrolling text is so much fun.....I can scroll forever!
</MARQUEE>
<script>
<!--
var count=11;

function countdown(){
count--;
changelayer_content(count);
if (count>0){
Id = window.setTimeout("countdown()",1000);
}



}

function changelayer_content(counter){
msgstring="<BR><P><FONT color=orange size=14>"+counter+" not here</Font>";

if(document.layers){
//thisbrowser="NN4";
fredlayer = document.layers[0];
fredlayer.document.open();
fredlayer.document.write(msgstring);
fredlayer.document.close();
}


if(document.all){
//thisbrowser="ie"
fredlayer = document.all["fred"];
fredlayer.innerHTML=msgstring;
}
if(!document.all && document.getElementById){
//thisbrowser="NN6";
fredlayer = document.getElementById("fred");
fredlayer.innerHTML =msgstring;


}
}
// -->
</script>
</body>
</html>
<html>

<layer name=pic z-index=0 left=200 top=100>
<img src="images/accuator.gif" width=160 height=120>
</layer>

<layer name=txt z-index=1 left=200 top=100>
<font size=+4> <i> Layers-Demo </i> </font>
</layer>

</html>


</script>
</body>
</html>

<HTML>


</html>

<LAYER left="0" top="0" name="bottom">
<IMG SRC="images/dog.gif">
</LAYER>

<SELECT name="bestcolor">
<OPTION SELECTED>blue
<OPTION>red
<OPTION>black
<OPTION>green
<OPTION>polka dots!
</SELECT>
</body>
</html>

theRatWonder
04-25-2007, 02:25 PM
please put your code in [code] tags. Makes it all much easier to read.

<layer> elements are only supported in netscape 3 and 4, and are not part of any HTML standard. Neither is <marquee>. You should not use either, but instead use CSS as a replacement for <layer> and javascript for scrolling text. Here (http://www.howtocreate.co.uk/jslibs/htmlhigh/simplemarquee.html) is an example of a javascript marquee script.

I would imagine your problem is related to limited support for these elements anyway.

Another note - you should consider familiarising yourself with xhtml style as I guarantee you will find it useful in the future. (here (http://www.w3schools.com/xhtml/xhtml_intro.asp markup) is a quick tutorial). The main points are:
- all tag names should be lower-case (<body> rather than <BODY>)
- all atribute names should be lower case and values should be in quotation marks (width="300" rather than WIDTH=300)
- all elements should be properly closed (<img src="myimg.gif" /> rather than <img src="myimg.gif" >)

Sorry to be preachy, but if you implement these principles I really think everything will work a lot better.

Robin.

ricp
04-25-2007, 03:46 PM
<marquee> .. ftw!

:p

theRatWonder
04-25-2007, 03:49 PM
??

DanielMorley
04-26-2007, 07:05 AM
A Marque to my understanding is a text that moves left to right across the screen.

theRatWonder
04-26-2007, 08:29 AM
yes...?

DanielMorley
04-26-2007, 08:56 AM
simplemarquee.js what is this file and how do I get it?

theRatWonder
04-26-2007, 09:33 AM
http://www.howtocreate.co.uk/jslibs/script-simplemarquee