setPosition : fixed, absolute position
$(document).ready(function () {
//setPosition("absolute") button execute : $("#orange").setPosition("absolute");
//setPosition("fixed") button execute : $("#orange").setPosition("fixed");
//setPosition(null) button execute : $("#orange").setPosition(null);
});
setPosition : Documentation
$(document).ready(function () {
//setPosition("absolute") button execute : $("#orange").setPosition("absolute");
//setPosition("fixed") button execute : $("#orange").setPosition("fixed");
//setPosition(null) button execute : $("#orange").setPosition(null);
});
The function setPosition specify a new position (like the position in CSS) with a translate offset option.
Technically, there is a Ghost inserted at the exact place and dimensions of the element beeing moved, the layout is not modified.
This function will simulate the CSS position attribute even for browsers which don't normally accept it (such as ie6, iPhone, iPad or other mobile's browsers).
setPosition full syntax
You can translate the element as specified in the offset parameter which is optional and each offset is optional.
- position : "absolute" | "fixed" | null,
- /* left overwrite right and top overwrite bottom if both are specified */
- offset : {
-
- top: value,
- left: value,
- bottom: value
- right: value
- }