Reputation: 283
How do I set y location using jQ offset().top?
$(#ele).offset().top = 123
Do I need to include 'px' or other appropriate unit in there?
Upvotes: 1
Views: 7525
Reputation: 3120
From the jQuery documentation
.offset( coordinates )
coordinates: An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
The properties top
and left
are integers, you don't need to include the 'px' unit
$("#ele").offset({ top: 123 });
Upvotes: 5