Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

offsetWidth is returning incorrect value

Okay so I'm attempting to make a horizontal site but when I try getting the offsetWidth of the navigation, it returns a value far higher than the true width. The design in question can be found here. The CSS for the page is here and the JS here.

Many thanks to anyone who can work this out :)

like image 325
Jordan Adams Avatar asked Aug 13 '12 00:08

Jordan Adams


1 Answers

This is how your page looks like just moment before CSS is applied: http://img571.imageshack.us/img571/1047/shotjt.png . In that moment width of #projects nav is width of client screen.

You have two solutions:

  1. specify width of #projects nav in style attribute
  2. add some timeout to the init JS function: domready(function() { setTimeout("initPageFunction()", 200); }

Surprisingly, it works good in IE :)

like image 134
Marko Vranjkovic Avatar answered Sep 29 '22 16:09

Marko Vranjkovic