Jquery-element-placer is a project mainly written in JavaScript, it's free.
A nifty little helper that enables you to place elements into a viewport in a way that they will always appear within the desired viewport
A nifty little helper that enables you to place elements into a viewport in a way that they will always appear within the desired viewport. This is extremely useful in combination with various pop-up overlays and tooltips which can have a variable width and height.
Copyright (c) 2010 Martin Tajur ([email protected]) Licensed under the GPL license and MIT:
$('.element').place({ top: 400, left: 400 });
$('.element').place({ top: 400, left: 400, area: 'document' });
top
: desired top offset of the placeable element in pixels (default 20
)left
: desired left offset of the placeable element in pixels (default 20
)margin
: desired margin from the viewport edges in pixels (default 0
)area
: desired viewport area in which the element should be visible in (either 'window'
or 'document'
, default 'window'
)