Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2008
    Posts
    56
    Thanks
    9
    Thanked 1 Time in 1 Post

    ticker broken in all but IE

    I have placed a ticker on my personal web page to thank someone, I would like this thing to work but I have no idea what I have done to it. I got the code from here http://www.mioplanet.com/rsc/newsticker_javascript.htm and the only changes I made to it was font color, size, and a couple changes to the HTLM code so it would is W3C Strict. It works in IE but doesn’t in any other browser. Any help accepted.

    My Site http://www.radamsiii.com/links.html
    .js
    Code:
    // WebTicker by Mioplanet
    // www.mioplanet.com
    
    TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
     TICKER_RIGHTTOLEFT = false;
    TICKER_SPEED = 2;
    TICKER_STYLE = "font-family:Elephant, Arial; font-size:14px; color:#000080";
    TICKER_PAUSED = false;
    
    ticker_start();
    
    function ticker_start() {
    	var tickerSupported = false;
    	TICKER_WIDTH = document.getElementById("TICKER").style.width;
    	var img = "<img src=ticker_space.gif width="+TICKER_WIDTH+" height=0>";
    
    	// Firefox
    	if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {
    		document.getElementById("TICKER").innerHTML = "<table width='100%'><tr><td nowrap='nowrap'>"+img+"<span style='"+TICKER_STYLE+"' id='TICKER_BODY' width='100%'>&nbsp;</span>"+img+"</td></tr></table>";
    		tickerSupported = true;
    	}
    	// IE
    	if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
    		document.getElementById("TICKER").innerHTML = "<div nowrap='nowrap' style='width:100%;'>"+img+"<span style='"+TICKER_STYLE+"' id='TICKER_BODY' width='100%'></span>"+img+"</div>";
    		tickerSupported = true;
    	}
    	if(!tickerSupported) document.getElementById("TICKER").outerHTML = ""; else {
    		document.getElementById("TICKER").scrollLeft = TICKER_RIGHTTOLEFT ? document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth : 0;
    		document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT;
    		document.getElementById("TICKER").style.display="block";
    
    		TICKER_tick();
    	}
    }
    
    function TICKER_tick() {
    	if(!TICKER_PAUSED) document.getElementById("TICKER").scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);
    	if(TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft <= 0) document.getElementById("TICKER").scrollLeft = document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth;
    	if(!TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft >= document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth) document.getElementById("TICKER").scrollLeft = 3;
    	window.setTimeout("TICKER_tick()", 30);
    }
    HTML
    Code:
    <!--Ticker-->
    <div id="TICKER" style="overflow:hidden; width:98%"  onmouseover="TICKER_PAUSED=true" onmouseout="TICKER_PAUSED=false">
     A special Thank You to Ashley's grandmother Teresa, without whom her educational dreams would be shattered.
    </div>
    <script type="text/javascript" src="ticker.js"></script>
    <br />

    Rick
    Dedicate some time to Educate your mind

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    I don't see any javascript code in the above link.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    May 2008
    Posts
    56
    Thanks
    9
    Thanked 1 Time in 1 Post
    I could not get it to work, so I went with a different Java code that works in other browsers. This code I cannot center or create bold script, have to run it in size 18, wanted 14 bold. The books I bought all talk about numbers and boxes, making things more for office type applications. What is a good book to get to learn this for a web application?

    Thank you for looking
    Rick
    Dedicate some time to Educate your mind


  •  

    Posting Permissions

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