Reputation: 5160
I need to get the CSS value Width of a DIV-Container. Then I will divide this width value through 245px.
Pseudo Code:
var articles = "#showroom ul" css width / 245px
Upvotes: 1
Views: 316
Reputation: 526
Depending on your specific needs, its worth mentioning the outerWidth() function. As it will return the width of the element, along with left and right padding, border, and optionally margin, in pixels.
http://api.jquery.com/outerWidth/
Upvotes: 0
Reputation: 80
for more specific dimensions see the dimension-functions in the jQuery manual
.outerWidth()
and .outerWidth(true)
are usefull in particular for elements with margins and borders
Upvotes: 0
Reputation: 12683
You'll want to use the width
function:
var articles = $('#showroom ul').width() / 245;
Upvotes: 5