1

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
1
  • Check out "visual jQuery." It's a pleasant, fast way to browse jQuery for functions like width(). api.jquery.com/visual Commented Nov 4, 2010 at 13:36

3 Answers 3

5

You'll want to use the width function:

var articles = $('#showroom ul').width() / 245;

jQuery width() function.

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

0

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/

1 Comment

Cool. Thank you for this additional info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.