0

This may be a really stupid question, but I'm new to jQuery and am not understanding its css property like I thought I was,

It's blowing my mind that

-webkit-transform: rotate(30deg); 

and

$("#cloud").css({
    "top" :  + 100 + "px",  
    "left" : "100px"});

work.

But that when I try and reuse that same idea here,

$("cloud").css({
    "-webkit-transform" : "rotate(30deg)"});

It doesn't work. It seems as though I am using the exact same syntax.

I apologize for the stupid question.

~Austin

3
  • 3
    Is that a typo or are you actually missing the # in your selector? Commented May 21, 2013 at 22:29
  • 1
    Funny how the smallest, most obvious mistakes can be the ones that make you tear out your hair in frustration. Commented May 21, 2013 at 22:47
  • Wow. Somebody should revoke my rights to publish. I spent an hour troubleshooting before I posted this up here. Maybe I should copy and paste next time. :P Commented May 21, 2013 at 23:01

2 Answers 2

2

It actually works: http://jsfiddle.net/nzmfW/ but you messed up the selector:

$("cloud").css({"-webkit-transform" : "rotate(30deg)"});

should probably be :

$("#cloud").css({"-webkit-transform" : "rotate(30deg)"});
Sign up to request clarification or add additional context in comments.

Comments

1

Try

$("#cloud").css({"-webkit-transform" : "rotate(30deg)"});

You are missing a # before the id in the selector in the second line.

Here's a jsFiddle.

Comments

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.