www.webdeveloper.com
Results 1 to 5 of 5

Thread: Color Change

Threaded View

  1. #1
    Join Date
    Aug 2014
    Posts
    2

    Color Change

    The following script (one of 5 such elements on my site) works as intended in my programming viewer, but do not work with my browsers, IE or Chrome. I have exhausted my personal programming resources trying to figure out why. Would someone, please be kind enough to tell me what will make it work. If so, I will be eternally grateful and in your debt.
    HTML Code:
    <HTML>
    <HEAD>
    <META NAME="Color Change" >
    <TITLE>Color Change</TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    
    <!--
    
    function makeArray()
    {
    	this.length = makeArray.arguments.length
    	for (var i = 0; i < this.length; i++)
    	{
    		this[i] = makeArray.arguments[i];
    	}
    } 
    
    var c3text = "<FONT SIZE='6'><STRONG>&ldquo; HEADER 2&rdquo;</STRONG></FONT>";
    var colorSpeed3 = 1000;
    var colorCounter3 = 0;
    var color3 = new makeArray("#FF8300", "#FFFF00", "#00FF00", "#00FFFF", "#0000FF", "#AA00FF", "#FF0000");
    
    //-->
    
    </SCRIPT>
    </HEAD> 
    <BODY BGCOLOR="#000032" BACKGROUND="images/StarField.gif" BGPROPERTIES="FIXED" TEXT="#00FFFF" LINK="#FFFF00" VLINK="#00FF00" ALINK="#FF00FF">
    
    <TABLE ALIGN="CENTER" WIDTH="1000">
      <TR>
          <TD><FONT SIZE="4">
    
    <TABLE ALIGN="CENTER" BORDER="0" WIDTH="600">
      <TR>
          <TD ALIGN="CENTER" WIDTH="500"><FONT COLOR="#FF0000">
    
      <A HREF="Header 2" TARGET="HEADER 2"><FONT COLOR="#FF0000">
    
    <SCRIPT LANGUAGE="Javascript">
    
    if (navigator.appName == "Netscape")
    {
    	document.write('<LAYER ID="c3"><CENTER>'+c3text+'</CENTER></LAYER><BR>');
    }
    
    if (navigator.appVersion.indexOf("MSIE") != -1)
    {
    	document.write('<DIV ID="c3"><CENTER>'+c3text+'</CENTER></DIV>');
    }
    
    function changeColor3()
    {
    	if(navigator.appName == "Netscape")
    	{
    		document.c3.document.write('<CENTER><FONT COLOR="'+color3[colorCounter3]);
    		document.c3.document.write('">'+c3text+'</FONT></CENTER>');
    		document.c3.document.close();
    	}
    	else if (navigator.appVersion.indexOf("MSIE") != -1)
    	{
    		document.all.c3.style.color = color3[colorCounter3];
    	}
    	if (colorCounter3 == color3.length - 1)
    	{
    		colorCounter3 = 0;
    	}
    	else
    	{
    		colorCounter3++;
    	}
    }
    
    setInterval("changeColor3()",colorSpeed3);
    
    </SCRIPT>
    </TABLE>
    <BR>
    </FONT>
    </TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>
    Last edited by jedaisoul; 08-30-2014 at 04:44 PM. Reason: code tags added

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles