Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
-5
rated 0 times [  2] [ 7]  / answers: 1 / hits: 19134  / 14 Years ago, tue, march 30, 2010, 12:00:00

Is it possible to change DIV position from absolute to relative (and from relative to absolute)?
DIV should remain on same place.


More From » jquery

 Answers
32

you can change that attribute with



$(object).css({position: 'absolute'});


For instance:

You could use jQuery's methods .position() or .offset() to set top and left
css attribute aswell, that way your object should stay at it's position changing
from relative -> absolute.



I don't think that works vice versa.



demo code: http://jsbin.com/uvoka


[#97207] Friday, March 26, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
parkernotnamedt

Total Points: 539
Total Questions: 90
Total Answers: 99

Location: Hong Kong
Member since Tue, Oct 19, 2021
3 Years ago
;