Hi I have a table with a div in it the table has 2 columns and both are 50% In most browsers I can use offsetWidth to get the width of the article. But in Safari the wid开发者_开发百科th is less or more than what it should be. Any help would be greatly appriciated. Regards Richard
offsetWidth
is not a standardized value across browsers. It may or may not include the scroll-bar width. You may get more consistent figures from clientWidth
which tends to exclude margins, borders and scrollbars.
Maybe the value of offsetWidth is gathered in different time that in other browsers. Try calling it in onload or ondomready event.
Just set the width and height - safari's bug -just accept it.
精彩评论