#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    15
    Rep Power
    0

    Scrolling Marque - works in IE, not in Firefox


    Can anyone tell me why this won't work in Firefox? Works great in IE...

    HTML:

    Code:
    <div id="marque">
    	<div id="marqueHeader" class="sidebarheading" style="font-size:20px;">The 2008 Salute to Small Business Awards</div>			
    	<div id="marqueSubHeader">The US Small Business Administration congratulates the following recipients:</div>
    	<div id="cont">
    			<div id="text">
    				Item 1<br /><br />
    				Item 2<br /><br />
    				Item 3<br /><br />
    				Item 4<br /><br />
    				Item 5<br /><br />
    				Item 6<br /><br />
    				Item 7<br /><br />
    				Item 8<br /><br />
    				Item 9<br /><br />
    			</div>
    	</div>
    </div>
    <script language="javascript" type="text/javascript">scrollInit(1);</script>
    CSS:

    Code:
    #marque {
       background-color:#FFFFE1; 
       padding:3px; 
       width:160px;}
    #marqueHeader {
       background-color:#000098; 
       color:white; 
       font-weight:bold; 
       text-align:left; 
       padding-left:3px;}
    #marqueSubHeader {
       font-family:'Arial Narrow', Arial, Helvetica, sans-serif, Verdana; 
       font-size:12px; 
       color:#000099; 
       text-align:left; 
       font-weight:bold;  
       padding:3px;}
    #cont {
       position:relative; 
       left:-3px; top:0px; 
       height:100px; 
       overflow:hidden;}
    #text {
       position:relative; 
       left:0px; top:0px; 
       height:1800px; 
       font-size:12px; 
       padding:5px; 
       text-align:left;}
    Javascript:

    Code:
    timerID = null;
    
    function scrollInit(speed)
    {
       	if (document.getElementById)
    		{
            	cnt = document.getElementById("cont");
            	txt = document.getElementById("text");
            	txt.style.top = 0;
    		timerID = setTimeout("scrollDown("+speed+")",30)
        		}
    }
            
    function scrollDown(speed)
    {
        	if(document.getElementById)
    		{
           	if(parseInt(txt.style.top) < -607)
    			{ txt.style.top = 0;}
    		txt.style.top = parseInt(txt.style.top) - speed + "px";
    		timerID = setTimeout("scrollDown("+speed+")",100)
       		}
    }
    Is it the relative positioning in the CSS? Does Mozilla still not have their act together on positioning?? Or is there something else I'm missing?

    I love Firefox as a browser, but developing for it can be a real pain...
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,142
    Rep Power
    120
    What is the actual problem you are having in FireFox? I tested in IE, Chrome and FireFox; and... your code seems to give the same effect in all three browsers; plus..., I did not get an error thrown, in any of the browsers.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    15
    Rep Power
    0
    You're right! It's working locally from my laptop - It seems that it only has a problem when I upload it to my domain - only then does it stop working in FF.

    Hmmmm....
  6. #4
  7. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,142
    Rep Power
    120
    Do you have any other code that maybe conflicting with your scrolling marquee code? Maybe some other code that you have or maybe even code; that your web host is inserting dynamically on their end. If you do not have any code that you have established; that maybe conflicting with your marquee code; then you might want to check the source code of your pages and see if the web host is inserting their own JS code (seen that happen before ).
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    15
    Rep Power
    0
    No, I just loaded the code from the post as is - looked at the page source online, and nothing has been added...

    The file is at cjreynolds.co/test.html - see if it works for you. Maybe its something in my internet security settings, but I have other scripts that seem to work
  10. #6
  11. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,142
    Rep Power
    120
    Looks like it works to me; I mean it's slow to start scrolling again, with the way you got scrollTop set-up to be a little to much, but then again; I was seeing that delay before. You might be able to remedy that with scrollHeight, but would be just something to consider; beyond your current concerns of your code not working in FireFox.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    15
    Rep Power
    0
    I just noticed - When I first load the page, the list doesn't move at all. Then if I refresh the page, it moves a little - sometimes enough to see Item 4, sometimes only enough to see part of Item 4. I'm gonna try it from my XP partition to see if maybe it's the version of FF, or if maybe I need to re-install the one on this partition. Strange indeed...

IMN logo majestic logo threadwatch logo seochat tools logo