User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,191 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,224 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Javascript breaks IE - please help.

Join Date: Dec 2007
Posts: 75
Reputation: hielo is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 10
hielo hielo is offline Offline
Junior Poster in Training

Re: Javascript breaks IE - please help.

  #2  
Dec 11th, 2007
No, it does not really work on FF either. There are tons of errors getting triggered and never stopping. These are all because you are not clearing the timeouts you are setting. Since the phrase contains 23 letters, you are not supposed to stop calling the timeout functions after letter 23. These should work across browsers.


<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta name="description" content="listenlight poetry journal" />
  <meta name="keywords" content="poetry" />

      <title>listenlight poetry journal</title>
  <style type="text/css">
    body {
		  background-image: url('/13/default.png');
      background-repeat: repeat;		font-size: x-large;
		  font-weight: bold;font-family: Tahoma, Geneva, Sans-Serif;
		  letter-spacing: 3px;
		  line-height: 1.2;  
     }
     
    #banner {
      position: absolute; bottom: 55%; left: 1%; right: 1%;
      text-align: center;
      font-family: Tahoma, Geneva, Sans-Serif; 
      letter-spacing: 10px;   
    }
  a.firefox:link      {color: skyblue; text-decoration: none; outline: none; cursor: default;}
  a.firefox:visited   {color: skyblue; text-decoration: none; outline: none; cursor: default;}
  a.firefox:active    {color: skyblue; text-decoration: none; outline: none; cursor: default;}
  a.firefox:hover     {color: darkblue; background-color: skyblue; text-decoration: none; outline: none; cursor: default;}
  
  a.archives:link     {
	  color: pink; text-decoration: none; outline: none; opacity: 0.3;
	  font-size: 80%; font-weight: bold; font-family: Tahoma, Geneva, sans-serif;
	 }
	   
	a.archives:visited  {
	  color: pink; text-decoration: none; outline: none; opacity: 0.3;
	  font-size: 80%; font-weight: bold; font-family:  Tahoma, Geneva, sans-serif;
	 }
	   
	a.archives:active   {
	   color: pink; text-decoration: none; outline: none; opacity: 0.3;
	   font-size: 80%; font-weight: bold; font-family:  Tahoma, Geneva, sans-serif;
	  }
	   
	a.archives:hover    {
	  color: black; text-decoration: none; outline: none; opacity: 0.3; font-variant: small-caps;
    font-size: 70%; letter-spacing: 15px; background-color: pink; font-weight: bold; font-family: Tahoma, Geneva, sans-serif;
   } 
   .letter{position:relative; visibility: hidden; font-size: normal;  color:black;}
    </style>     
  
  <script type="text/javascript">
  var timer=[];
  	colors = new Array(14)
  	colors[0]="0"
  	colors[1]="1"
  	colors[2]="2"
  	colors[3]="3"
  	colors[4]="4"
  	colors[5]="5"
  	colors[5]="6"
  	colors[6]="7"
  	colors[7]="8"
  	colors[8]="9"
  	colors[9]="a"
  	colors[10]="b"
  	colors[11]="c"
  	colors[12]="d"
  	colors[13]="e"
  	colors[14]="f"

  function genTextHex(){
  
  	colorStart="#"
  	for (j = 0; j == 0; j++){
      color = colors[6 + Math.floor(Math.random() * 7)] 
            + colors[6 + Math.floor(Math.random() * 7)]
            + colors[6 + Math.floor(Math.random() * 7)]
            + ";";
  	}
  	return colorStart + color;
  }

  function genHex() {

  	colorStart="#"
  	var r = colors[6 + Math.floor(Math.random() * 8)] 
  	var g = colors[6 + Math.floor(Math.random() * 8)] 
  	var b = colors[6 + Math.floor(Math.random() * 8)] 

  	return colorStart + r + g + b + "";
  }


  function alter() {
   	i = Math.floor(Math.random() * 24);
	
  	document.getElementById("L"+i).style.color=genHex();	
   }

  var letter = 0;
  
  function alterText() {

    document.getElementById("L"+letter).style.visibility="visible";
    document.getElementById("L"+letter).style.fontSize=Math.floor(140 + Math.random() * 100) + "%";  	  	   
    document.getElementById("L"+letter).style.color=genHex();
    letter++; 
     if(letter>23)
	{
		clearTimeout(timer[0]);
		clearTimeout(timer[1]);
		clearTimeout(timer[2]);
	}  
   }


  </script>


</head>
<body>

<div id="banner">
  <a style="text-decoration:none; outline: none" href="/13/iijima">

<span id="L0" class="letter" style="top:16px;">l</span><span id="L1" class="letter" style="top:-5px;">i</span><span id="L2" class="letter" style="top:7px; ">s</span><span id="L3" class="letter" style="top:-11px;">t</span><span id="L4" class="letter" style="top:10px;">e</span><span id="L5" class="letter" style="top:-3px;">n</span><span id="L6" class="letter" style="top:4px;">l</span><span id="L7" class="letter" style="top:-8px;">i</span><span id="L8" class="letter" style="top:15px;">g</span><span id="L9" class="letter" style="top:11px;">h</span><span id="L10" class="letter" style="top:-12px;">t</span><span id="L11" class="letter" style="top:8px;">p</span><span id="L12" class="letter" style="top:14px;">o</span><span id="L13" class="letter" style="top:6px;">e</span><span id="L14" class="letter" style="top:1px;">t</span><span id="L15" class="letter" style="top:-16px;">r</span><span id="L16" class="letter" style="top:0px;">y</span><span id="L17" class="letter" style="top:-9px;">j</span><span id="L18" class="letter" style="top:-10px;">o</span><span id="L19" class="letter" style="top:-2px;">u</span><span id="L20" class="letter" style="top:-18px;">r</span><span id="L21" class="letter" style="top:17px;">n</span><span id="L22" class="letter" style="top:3px;">a</span><span id="L23" class="letter" style="top:11px;">l</span>  </a>

  </div>
  
<div style="position:absolute; bottom: 15%; left: 10%; right: 10%; text-align:left; color: darkkhaki; font-size: small; letter-spacing: 2px; border: 1px solid cornflowerblue; padding: 1.5em;">
  <br/>Issue 13 for December 2007
  <br/>Editors Jesse Crockett and Guillermo Parra
  <br/>Address query or submitted work to jesse -at listenlight.net
  <br/>  
  <br/>Archive Issues <big><a class="archives" href="/12">&nbsp;12</a> &bull; <a class="archives"  href="/11">&nbsp;11</a> &bull; <a class="archives"  href="/10">&nbsp;10</a> &bull; <a class="archives"  href="/09">&nbsp;09</a> &bull; <a class="archives"  href="/08">&nbsp;08</a> &bull; <a class="archives"  href="/07">&nbsp;07</a> &bull; <a class="archives"  href="/06">&nbsp;06</a> &bull; <a class="archives"  href="/05">&nbsp;05</a> &bull; <a class="archives"  href="/04">&nbsp;04</a> &bull; <a class="archives"  href="/03">&nbsp;03</a> &bull; <a class="archives"  href="/02">&nbsp;02</a> &bull; <a class="archives"  href="/01">&nbsp;01</a> &bull; <a class="archives"  href="/00">&nbsp;00</a></big>

  </div>

<div style="position:absolute; top: 88%; left: 12%; right: 12%; opacity: 0.5; line-height: 1.3em; text-align: left; color: darkkhaki; font-size: x-small; font-variant: bold; letter-spacing: 2px; border: 1px solid darkkhaki; padding: 1.2em; font-family: Tahoma, Geneva, Sans-Serif;">
       Listenlight 13 has not been optimized for the Internet Explorer web browser.
  <br/>To obtain a Web Standards Compliant browser, please visit <big><a class="firefox" style="opacity: 0.7; border-bottom: 2px solid cornflowerblue;" href="http://www.mozilla.org">&nbsp;www.mozilla.org&nbsp;</a></big>
  </div>

  <script type="text/javascript">
  window.onload=function(){
    		timer[0]=setInterval("alterText();", 110);
    		timer[1]=setInterval("alter();", 100);
	   	timer[3]=setInterval("alter();", 100);         
	}
    </script>

  	<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
  			</script>

  			
  		<script type="text/javascript">
  			_uacct = "UA-493923-1";
  			urchinTracker();
  			</script>
</body>
</html>
Reply With Quote  
All times are GMT -4. The time now is 10:09 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC