Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Browser-prefixed CSS properties in jQuery

Browser-prefixed CSS properties in jQuery

Problem

I am trying to add box-flex to a 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.

Problem courtesy of: Vegard Larsen

Solution

Did you try

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

(Note the extra quotes after the comma)

Solution courtesy of: John

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

Browser-prefixed CSS properties in jQuery

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×