Results 1 to 10 of 10

Thread: Mike's Scroller in FF

  1. #1
    Join Date
    Apr 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Mike's Scroller in FF

    1) Script Title: Mike's DHTML scroller

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...mikescroll.htm

    3) Describe problem: The script works perfectly on IE6 en 7, but FF messes the script up.

    http://www.quizlet.nl/

    All content is cluttered up in the left top-corner of the screen.

    What's going wrong? And how can I fix this?

    Thanks a bunch for the help!!

  2. #2
    Join Date
    Jan 2007
    Posts
    82
    Thanks
    30
    Thanked 18 Times in 17 Posts

    Default

    I have used this script in the past, and have had no issues with firefox. Post the code you are using and I'll look for any errors you may have.

    Also a link to the live page containing the script would be helpful in assisting with any problems you may have.

  3. The Following User Says Thank You to tonyking For This Useful Post:

    damara (04-22-2008)

  4. #3
    Join Date
    Apr 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ths script is live at http://www.quizlet.nl/

    You can find the source over there.

    Thanks very much for your help! (Y)

  5. #4
    Join Date
    Jan 2007
    Posts
    82
    Thanks
    30
    Thanked 18 Times in 17 Posts

    Default

    Well the first thing I see is your references to the 2 javascripts are in the BODY of your page and not the HEAD, try moving the below code:

    Code:
    <script language="JavaScript" src="http://www.quizlet.nl/template/javascript/dhtmllib.js"></script>
    <script language="JavaScript" src="http://www.quizlet.nl/template/javascript/scroller.js"></script>
    Into the head of your webpage, not the body. The code below that stays there.
    If that doesn't correct the problem, (which I think it should) just post again and I'll actually look into the code itself.

  6. The Following User Says Thank You to tonyking For This Useful Post:

    damara (04-22-2008)

  7. #5
    Join Date
    Apr 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hey!

    It took me a lot of testing but I found out that the following code is causing the Firefox problems:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    Do you know how that's possible? And if I can change the script so I can put the doctype declaration back in place?

  8. #6
    Join Date
    Jan 2007
    Posts
    82
    Thanks
    30
    Thanked 18 Times in 17 Posts

    Default

    I looked at your page in FF, and the script looks good. I don't think that declaring the document type as strict 1.0 should have any effect on this javascript.

    If you place the statement back in the head of the document and have issues, there's some non-compliant attribute in the .css associated with the scripts container.

  9. The Following User Says Thank You to tonyking For This Useful Post:

    damara (04-22-2008)

  10. #7
    Join Date
    Apr 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The script looks fine in FF now, because I managed to remove the DOCTYPE part when someone visits the page using FF.

    Using google I found out that more scripts have this problem with doctype and FF.

  11. #8
    Join Date
    Jan 2007
    Posts
    82
    Thanks
    30
    Thanked 18 Times in 17 Posts

    Default

    That's good to know, I'd like to read the article as well if you have a link.

  12. The Following User Says Thank You to tonyking For This Useful Post:

    damara (04-22-2008)

  13. #9
    Join Date
    Jun 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If anyone is still encountering this problem, this fix worked for me and will probably work for you:

    Make the following changes to dhtmllib.js:

    In the function moveLayerTo, change the following lines...

    Code:
    layer.style.left = x;
    layer.style.top  = y;
    to:

    Code:
    layer.style.left = x + "px";
    layer.style.top  = y + "px";
    In the function moveLayerBy, change the following lines...

    Code:
    layer.style.left= parseInt(layer.style.left)+dx;
    layer.style.top= parseInt(layer.style.top)+dy;
    to:

    Code:
    layer.style.left= parseInt(layer.style.left)+dx+"px";
    layer.style.top= parseInt(layer.style.top)+dy+"px";
    And finally, in the function clipLayer, change the following line...

    Code:
    layer.style.clip = 'rect(' + cliptop + ' ' +  clipright + ' ' + clipbottom + ' ' + clipleft +')';
    to:

    Code:
    layer.style.clip = 'rect(' + cliptop + 'px,' +  clipright + 'px,' + clipbottom + 'px,' + clipleft +')';
    I think the basic idea is that when you specify an XHTML DOCTYPE, Firefox goes into 'standards mode' (as opposed to 'quirks mode') which expects properties to be defined using a strict syntax. This code is quite old, and so it specifies some values in what I'm guessing is now deprecated syntax, which Firefox ignores (causing strange behaviour). The above changes specify the relevant property values using the proper syntax. It seems to work fine for FF2, IE6 and IE7 (should work for FF3, not sure about older versions of IE or other browsers).

    This may also be the problem with some of the other scripts you referred to, especially if they are old. I hope this helps someone.

  14. #10
    Join Date
    Sep 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    at first load i am not getting error now. but after the first delay, the same error appears again.

Bookmarks

Posting Permissions

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