Why my .style.left doesn”t work with FireFox?
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?
Facebook comments:
11 Responses to Why my .style.left doesn”t work with FireFox?
Leave a Reply Cancel reply
Archives
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- March 2011
- February 2011
- January 2011
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- January 2010
- December 2009
- October 2009
- August 2009
- July 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- June 2007
Tags
.net 2008 asp.net asp.net mvc asus eee c# corona cpa doctrine dom eee eee pc Internet Marketing ios iPad iphone iPhone development iphone sdk javascript make money netbook online marketing pagerank passion php playstation playstation 3 ps3 ranking ror ruby on rails self help Self Improvement self motivation seo sql success symfony take action the secret ultra compact laptop ultra compact notebook vb.net web development wordpress





Thanks for the “Simple & Stupid” knowledge
Yeah, it made me stupid for a while.
Thanks so much, this would have taken me forever to figure out.
Oh man how stupid! THANKS A LOT!
Hi Seree well done!
It was really useful.
Thank you so much,
Marco.
Thanks your solution save me.. Very nice work !!
Thanks Seree !
You save my day with this tip!
Thanks Man! Greetings from Portugal.
Wow…did it for me, too.
you rock. simple AND stupid!!!
thanks a ton!
Thanks Seree. Saved a lot of time.