proseidon
proseidon

Reputation: 2305

Changing CSS margin in jquery as a negative percentage

I have this in CSS:

.inner{ margin-left: -100% };

How would I assign this in jquery?

$('.inner').css("margin-left", -100%);

doesn't work.

Upvotes: 0

Views: 464

Answers (2)

Anton
Anton

Reputation: 32581

Try this :

$('.inner').css("margin-left", "-100%");

Upvotes: 1

Arvind Bhardwaj
Arvind Bhardwaj

Reputation: 5301

Include quotes or double quotes around the value.

$('.inner').css("margin-left", "-100%");

Upvotes: 1

Related Questions