Doug Molineux
Doug Molineux

Reputation: 12431

CSS3 Perspective, Transform and Transition Altered With jQuery

I have been playing around with these CSS3 properties and I've been able to do some really cool things with them. I got the initial example from this website. I was wondering if any of these properties can be altered with the .css function available in jQuery. I can't seem to find any reference to this on Google. Here's what I have set to a div element on my page.

-moz-box-shadow:0 20px 40px #888; 
-webkit-box-shadow:0 20px 40px #888;
-webkit-transform: translateZ(30px) rotateY(30deg);
-webkit-transition-property: transform, box-shadow, margin; 
-webkit-transition-duration: 0.5s;

I know from my experience with the css function that it doesn't support hyphens in the property name such as "margin-left". So if there's currently no support, is jQuery going to add in support anytime in the future?

Thanks!

Upvotes: 0

Views: 1985

Answers (1)

methodofaction
methodofaction

Reputation: 72405

jQuery supports hyphens, you just have to quote your css propierties, ex:

$(".whatever").css("margin-left", "-10px");

Here is a demo with css transforms:

http://jsfiddle.net/Ld2p2/

Upvotes: 2

Related Questions