$(".one").position({
"my": "right top",
"at": "right top",
"of": $(".main"),
});
I need to my box still stay right-top when i resize window... I try to use "collision": "fit fit" ..... it not work
You could just re-position on resize:
function moveit() {
$(".one").position({
"my": "right top",
"at": "right top",
"of": $(".main"),
"collision": "fit fit"
});
}
$(window).resize(function(){
moveit();
});
moveit();
Alternatively, assuming there's not some other reason you can't just use css:
Just set the parent positon:relative
and set the child position:absolute
. Then you can just set the child top:0; right:0
top:0; right:0
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.