splatio
splatio

Reputation: 504

jQuery .innerWidth() giving different values in different browsers

I'm trying to make an image gallery using the jQuery UI slider widget. My code requires me to find the inner width of an unordered list. In Firefox, IE and Opera I get a value of 2193px for this however in Chrome this value is 44px!

When I hardcode 2193px into the width of the UL it works fine in Chrome.

Here's a link to the code Slider Test

Upvotes: 2

Views: 1175

Answers (1)

mikesir87
mikesir87

Reputation: 1797

I would be interested in this answer too... At times, I've found that the scripts can run before the images are loaded in the browser. That causes the values to be different, as the widths aren't established yet. Try putting the height and width in a style tag for each image, and see if that works.

Upvotes: 2

Related Questions