This is a simple & stupid knowledge that I taken about 2 days to solve it.

I have a project that have to use this code….

var con = document.getElementById(“menu”);

con.style.left = “10″;

con.style.top = “20″;

When I run this code in Internet Explorer 6, 7.

I got it working like I want!

But when I try with Mozilla FireFox.

It never works!

Man! I hate DOM, if I have enough money. I’ll buy Microsoft and stop Internet Explorer project to reduce browser compatibility issues. :-)

I try to use FireBug to change the css real-time, it does work very well.

The key point of this issue is that YOU MUST APPEND the property with UNIT!

I changed the code to…

con.style.left = “10px”;

con.style.top = “20px”;

And now it works!

Gotcha!

Simple & Stupid, right?

Tagged with:
 

Facebook comments:

11 Responses to Why my .style.left doesn”t work with FireFox?

  1. Umair says:

    Thanks for the “Simple & Stupid” knowledge :)

  2. Seree says:

    Yeah, it made me stupid for a while. :D

  3. Chris says:

    Thanks so much, this would have taken me forever to figure out.

  4. DF says:

    Oh man how stupid! THANKS A LOT!

  5. Marco says:

    Hi Seree well done! :)
    It was really useful.
    Thank you so much,
    Marco.

  6. Arnold Kim says:

    Thanks your solution save me.. Very nice work !!

  7. JSoares says:

    Thanks Seree !
    You save my day with this tip!

  8. DEUScronio says:

    Thanks Man! Greetings from Portugal.

  9. Noji says:

    Wow…did it for me, too.

  10. rick james says:

    you rock. simple AND stupid!!!
    thanks a ton!

  11. Pradeep says:

    Thanks Seree. Saved a lot of time.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Looking for something?

Use the form below to search the site:


Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

reverse phone lookupTattoo DesignsSEO