dzm
dzm

Reputation: 23534

jQuery animate to offset/position

I'm using jQuery animate to change the position of an element:

$('#item').animate({'top' : '-50'}, 0);

I don't need the animation, I just want to set the position. I tried both offset and position, but neither seemed to work right.

How should update this to not use animate?

Thank you!

Upvotes: 0

Views: 198

Answers (1)

ajtrichards
ajtrichards

Reputation: 30565

You could try:

$('#item').css({'top' : '-50'});

Upvotes: 4

Related Questions