1

I am trying to add box-flex to a <p> using jQuery. For now, box-flex is browser-prefixed. For Chrome/Safari you can then do -webkit-box-flex: 1 to set it. However, setting this property using jQuery does not work.

JSBin that demonstrates the problem

// this does not work
element.css('-webkit-box-flex', 1);

I've tried setting -webkit-box-flex, box-flex, WebkitBoxFlex, webkitBoxFlex and probably a few more combinations I can't remember.

I need runtime-defined box-flex values for each box, so the code above is very simplified.

1 Answer 1

7

Did you try

element.css('-webkit-box-flex', '1'); 

(Note the extra quotes after the comma)

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

1 Comment

Yes, this works beautifully. I had to wait before SO would allow me to approve it... :)

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.