www.webdeveloper.com
Results 1 to 11 of 11

Thread: Mioplanet js ticker won't work in Firefox

  1. #1
    Join Date
    Oct 2010
    Location
    SC
    Posts
    15

    Mioplanet js ticker won't work in Firefox

    This is funny cuz I just got done saying this morning that everything works in FF. Well...I guess I don't know what I'm talkin about. What I'm trying to do is pretty simple. I just want to use this code to put in a ticker message at the top of my page. Just a static message. It works great in IE and Safari, but in FF it just sits there and doesn't tick. Firefox does display my 'TICKER_STYLE' changes tho. This is where I got the code from www.mioplanet.com. Below is the javascript from webticker_lib.js:

    Code:
    // WebTicker by Mioplanet
    // www.mioplanet.com
    
    TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
     
    TICKER_RIGHTTOLEFT = false;
    TICKER_SPEED = "2";
    TICKER_STYLE = "font-family:Arial; font-size:16px; color:#000066;";
    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  cellspacing='0' cellpadding='0' 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 = 0;
    	window.setTimeout("TICKER_tick()", 30);
    }
    And here is what I have in my page:
    HTML Code:
    <td>
          		<div id="TICKER" STYLE="overflow:hidden; width:520px">
      			All store feeds are currently functioning!  Have a productive day!
    			</div>
    		</td>
        		<script type="text/javascript" src="webticker_lib.js" language="JavaScript"></script>  
    Here is what I've tried so far:
    1. I've tried moving the <script></script> piece all over the place. haha. This includes the head.
    2. I took the javascript piece for if (navigator.userAgent.indexOf("MSIE")!=-1 ...{ ... and tried that with "Firefox"
    3. I changed some tags around. Don't recall all of what I changed there, but nothing worked. I have a feeling it's tag related because in the webticker_lib.js I changed 'var tickerSupported = false;' to true and that didn't work.
    4. Also, I know it's recognizing my browser as FF because I took the 'indexOf("Firefox")' piece out and it then displayed the 'else {' markup without my css changes.


    Any help will be greatly appreciated. This is bugging me. I've spent about 4 hours on it already. If you need more info just let me know. I'm using this on a company site so can't url it.

    P.S. I read the stickys. lol.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>
    
    </head>
    <body>
                  <div id="TICKER" STYLE="overflow:hidden; width:520px">
                  All store feeds are currently functioning!  Have a productive day!
                </div>
    <script type="text/javascript">
    // WebTicker by Mioplanet
    // www.mioplanet.com
    
    TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
     
    TICKER_RIGHTTOLEFT = false;
    TICKER_SPEED = "2";
    TICKER_STYLE = "font-family:Arial; font-size:16px; color:#000066;";
    TICKER_PAUSED = false;
    
    
    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">';
    
            document.getElementById("TICKER").innerHTML = "<TABLE  cellspacing='0' cellpadding='0' width='100&#37;'><TR><TD nowrap='nowrap'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>"+img+"</TD></TR></TABLE>";
            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();
        }
    
    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 = 0;
        window.setTimeout("TICKER_tick()", 30);
    }
    
    window.onload=function() {
    ticker_start();
    };
    </script>
    
    </body>
    </html>
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Oct 2010
    Location
    SC
    Posts
    15

    Mioplanet js ticker won't work in Firefox

    Thanks Fang. But it's a no go. I'm using Firefox 3.6.10. What version are you using? P.S. Your version still works great in IE and Safari.

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Works in Fx. Did you make any changes?
    At least 98% of internet users' DNA is identical to that of chimpanzees

  5. #5
    Join Date
    Oct 2010
    Location
    SC
    Posts
    15
    I tried it again and it just sat there. Then I added more words to display --- "All store feeds are currently functioning! Have a productive day! Blah blah blah. really long information. it just keeps coming?". It's moving now. But it starts displayed. Then scrolls to the end and flashes back to the beginning, making it hard to read. So it doesn't start hidden then scroll right to left until hidden again. Then start over. Does that make sense?

    No I didn't change anything.

  6. #6
    Join Date
    Oct 2010
    Location
    SC
    Posts
    15
    What version of Fx are using please? I copied and pasted your code into notepad, named it testticker.html and ran it with the same results.

  7. #7
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Fx 3.6.10
    Runs even with your longer text.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  8. #8
    Join Date
    Oct 2010
    Location
    SC
    Posts
    15
    Wow. You're making me feel crazy. I've ran it on three different computers now. All with the same result. If you mean by "runs" that the text moves than yes it "runs" when I put in the longer text. But it's supposed to start hidden and move across the cell until it's hidden again. Can you confirm that it runs the exact same in Fx as it does in IE for you?

  9. #9
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    The same
    At least 98% of internet users' DNA is identical to that of chimpanzees

  10. #10
    Join Date
    Nov 2011
    Posts
    1

    Same issue!

    Hey - I have the same issue with FF and Webticker.
    My code works perfectly in Chrome and IE - but it pops in FF. It scrolls till the end and pops to the start. I have tried tweaking it as much as I can - but can't figure out the problem.

    Did you manage to fix yours?

    Thanks.

  11. #11
    Join Date
    May 2012
    Posts
    1

    Fixed in Firefox

    This worked for me...

    There's a line of code in the webticker_lib.js... line 17...

    var img = "<img src=ticker_space.gif width="+TICKER_WIDTH+" height=0>";


    There's a default image that's referenced and i didn't notice that it was included with the download. I uploaded a clear pixel gif to the server, changed the img src = "this stuff in here" to reference the location of the image and it got rid of the annoying jumping and bounce back that was happening when the scroll would near the end of the side.

    Hope this helps... even though it's an older post.

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