1

Hello guys probably i'm having a problem on setting property

transform: rotate(30deg) 

in my selector

$('.box1').css('left', x); 

I dont know where to add this line, can I put a variable in degrees? Thanks guys. I hope you can help me out fixing this.

2
  • Please post more of your code Commented Nov 20, 2013 at 11:37
  • $('.box1').css('transform', 'rotate(30deg)'); innit? Commented Nov 20, 2013 at 11:37

2 Answers 2

3

Simply:

$('.box1').css({
    left: x,
    transform: 'rotate(30deg)'
});

Or:

$('.box1').css('left', x).css('transform', 'rotate(30deg)');

JSFiddle demo.

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

2 Comments

by the way i would like to do this when i scroll my mouse jsfiddle.net/juzjs
@user3012847 that should be asked as a different question. My answer here answers the question you've asked.
0

Use this

$('.box1').css('left', x).css('transform', 'rotate(30deg)')

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.