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
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,789
    Thanks
    6
    Thanked 1,022 Times in 995 Posts

    Image Trail script only works in quirks mode

    So I found this nice script while coming across templatemonster.com where when you hover over a small preview image a bigger image appears. According to the js file this is from javascriptkit.com but I couldn't find it there and had to figure out how to install it myself.

    Everything worked nicely but then, after looking at the integrated error console in Fx (Extras > Error Console), I noticed that it's producing some kind of infinite loop or something like that on my page while it didn't on templatemonster.com. I found out that the error is caused by the doctype, hence with the browser in standards mode whereas templatemonster's site is in quirks mode and not having this error.

    I've uploaded the relevant files for you to conveniently review the problem. The stripped-down-to-a-minimum HTML file demonstrates the issue. The error comes from the loader.js. The console says that there's an error occuring while processing the values for the width and left properties and it's ignoring the declaration but somehow it seems to read it over and over.

    As I said this is only happening if I have a doctype in the HTML document. Can anyone give me a hint on how to make it work without errors in standards mode?

    Thanks a lot.

  • #2
    Regular Coder
    Join Date
    Jun 2004
    Posts
    565
    Thanks
    0
    Thanked 18 Times in 18 Posts
    Replace those lines:
    Code:
    elem.style.left = pos;
    elem.style.width = len;
    with this:
    Code:
    elem.style.left = pos + "px";
    elem.style.width = len + "px";
    and see if that helps.

    dumpfi
    "Failure is not an option. It comes bundled with the software."
    ....../)/)..(\__/).(\(\................../)_/)......
    .....(-.-).(='.'=).(-.-)................(o.O)...../<)
    ....(.).(.)("}_("}(.)(.)...............(.)_(.))Ż/.
    ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
    Little did the bunnies suspect that one of them was a psychotic mass murderer with a 6 ft. axe.

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,789
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    Oh yeah baby, that was it! Thanks a lot, man.


  •  

    Posting Permissions

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